Compacting SQLite bases of Firefox 3

SQLite is a powerful database that works behind the scenes of Mozilla Firefox Internet Web Browser by storing its history, bookmarks, the anti-phishing elements, etc. Aiming to provide optimum performance, data is kept secured and searching becomes faster by using SQLite. A little tweak can provide quality output from parts of Mozilla Firefox, although there are a couple of drawbacks with SQLite. It takes quite a large amount of disk space and unless and until modified, Mozilla Firefox can't compact the database part. After downloading SQLite from specific sites, some little adjustments need to be made in Mozilla Firefox so that the size of the SQLite decreases.


Firefox 3 uses SQLite database to store the history, bookmarks, the anti-phishing, etc..
SQLite is a very powerful database.

  • This helps to provide excellent performance, very fast searching and ensure that data will not be corrupted.
  • The disadvantage is that SQLite is a bigger database and takes up more space. Firefox does not compact these databases regularly.
  • These are the files. Sqlite content in your Firefox profile (home directory).
  • Here is a manipulation that reduces the size of these files without any loss of data:
  • This manipulation does no data base: It is fair to claim the unused disk blocks SQLite files.

Download SQLite


  • Close Firefox (important)
  • Then type:
    sqlite databasename.sqlite "VACUUM" 
  • (For example: sqlite urlclassifier3.sqlite "VACUUM")
  • The size of the SQLite files should be decreased.


  • To optimize all SQLite files, here is a batch for Windows:
    • @FOR %%G IN (*.sqlite) DO ( sqlite3 %%G "VACUUM" )
  • You can copy this file. Def (and sqlite3.exe) in the directory containing your .Sqlite files and run from time to time.
Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Compacting SQLite bases of Firefox 3 », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (