.fw files.wiki
SQLITE

SQLITE Files

SQLite Database File

An .SQLITE file is a self-contained SQLite database storing relational tables, indexes, triggers, and metadata in one binary file.

SQLite 3 database

Most common
Developer
D. Richard Hipp / SQLite Consortium
Category
Data & Text
MIME type
application/vnd.sqlite3
Format
Binary
Magic bytes
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00
First released
2004-06
Latest version
SQLite format 3; schema format 4
Open standard
Yes

SQLCipher encrypted SQLite database

Developer
Zetetic LLC
MIME type
application/octet-stream
Format
Binary
First released
2008
Latest version
SQLCipher 4 format
Open standard
No

SpatiaLite geodatabase

Developer
Alessandro Furieri / Gaia-SINS
MIME type
application/vnd.sqlite3
Format
Container
Magic bytes
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00
First released
2008
Latest version
5.x
Open standard
Yes

SQLite 2 database

Developer
D. Richard Hipp
MIME type
application/x-sqlite2
Format
Binary
Magic bytes
2A 2A 20 54 68 69 73 20 66 69 6C 65 20 63 6F 6E 74 61 69 6E 73 20 61 6E 20 53 51 4C 69 74 65 20 32 2E 31 20 64 61 74 61 62 61 73 65 20 2A 2A
First released
2001
Latest version
2.8.17
Open standard
Yes

Online .SQLITE Text Viewer

Reading file…

What is a .SQLITE file?

The extension .sqlite indicates the usage of SQLite 3. This file type belongs to the relational databases family without server usage, consisting of one binary file. The development and current development of the tool belong to D. Richard Hipp and The SQLite Consortium correspondingly since the release of SQLite 3 back in 2004. As a consequence, .sqlite databases became widespread in usage in desktops, phones, web browser applications, IoT gadgets and embedded systems.

Typically, such file would contain such objects as tables, rows, indices, views, database schema with table structure definition, free list at the page level, application-specific metadata in one binary file. Files with the specified extension can be found mostly in application profiles, cache folders, database exports or database tests on websites with mobile applications backups, GIS projects with geoinformational analysis purposes as well as small independent application which do not use server-based relational database system.

Moreover, some of the SQLite 3 .sqlite files might consist SQLCipher encrypted database, produced with the software implementing SQLite variant of Zetetic with encryption abilities. Such a file would represent random binary pattern that would not work with standard SQLite tools unless proper key/cipher configuration is provided.

There exist SpatiaLite .sqlite files. Those are SQLite databases with GIS metadata tables like 'geometry_columns' and 'spatial_ref_sys', as well as fields containing geometry in BLOB data format. Very seldomly there could be the SQLite 2 files starting with "This file contains an SQLite 2.1 database".

How to open a .SQLITE file

Open a .SQLITE file on Windows

  1. 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
  2. 2 Double-click your .SQLITE file if you have an app for .sqlite files on your computer. In case it does not open, move on to step three.
  3. 3 Right-click your .SQLITE file -> select Open with -> Choose another app.
  4. 4 Choose DB Browser for SQLite in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .sqlite files" and click OK.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Windows

Open a .SQLITE file on macOS

  1. 1 In the Finder app, locate your .SQLITE file.
  2. 2 Just double-click your .SQLITE file in order to automatically launch the program which is connected with it.
  3. 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select Open With -> DB Browser for SQLite.
  4. 4 If it isn't in the list, choose Other… and find the application manually.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for macOS

Open a .SQLITE file on Linux

  1. 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
  2. 2 Double-click the file.
  3. 3 Or choose another program by right-clicking the file -> Open With -> DB Browser for SQLite.
  4. 4 Install DB Browser for SQLite (if it is not installed on your computer) from the software centre, repository or Flathub.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Linux

Open a .SQLITE file on Android

  1. 1 Launch Files or another file management app.
  2. 2 In Downloads, find the .SQLITE file and open it by tapping.
  3. 3 A list of apps capable of opening the file will be shown. Tap a suitable app and press Always to permanently connect the file type with this app.
  4. 4 No apps able to open this file? Download a suitable app from the Google Play Store.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Android

Open a .SQLITE file on iPhone / iPad

  1. 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
  2. 2 Tap the .SQLITE file you want to open.
  3. 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
  4. 4 Touch and hold the file to get the context menu -> choose Share -> select TablePlus from the list of apps.
  5. 5 If there is no such option, download the app first from the App Store and then tap the document again.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for iPhone / iPad

Open a .SQLITE file online

  1. 1 Move to the online viewer at the top of this page.
  2. 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Online

More details about opening .SQLITE files

To work with .sqlite in Windows, macOS and Linux use the reference tool called SQLite command-line shell that you will need to check the readability of the .sqlite file, list tables with .tables command, execute SELECT queries, make .dump (to get an SQL backup of tables and rows stored inside your file), check integrity via PRAGMA integrity_check. For working with the old SQLite 2 databases you may need an SQLite 2.8 command line tool. There are plenty of alternative desktop graphical tools that don’t cost anything (they are freely available): DB Browser for SQLite and SQLiteStudio - they give the ability to browse all tables contained within .sqlite, change row values and table schemas as well as to import CSVs or export to SQL and CSV (they are available for Windows, macOS, Linux). DBeaver Community is also free and works on all OSes - it allows users having more complex work with various DBMS including SQLite in conjunction with PostgreSQL, MySQL, Oracle and so forth. For people who are willing to pay you might choose the following paid / freemium desktop applications: JetBrains' DataGrip, TablePlus, Valentina Studio.

As for iOS and macOS SQLiteFlow (similar to SQLPro) is helpful for viewing application's .sqlite, making updates, exporting some rows of tables. For Android users it isn't possible by default for you to be able to open any SQLite file (from an Android app) on your Android device unless it was properly extracted to SD card from your app because most of the .sqlite file readers (SQLCipher reader / SQLite Reader and so forth) do appear to be used as database engines for SQLite in Android apps only. GIS SQLite: QGIS supports opening SpatiaLite layers for mapping purposes while tools that provide some command line functionality like gdal / ogr are better for some scripting purposes as well as reprojecting and transforming. SQLite Web viewers allow users to look through a standard SQLite database but not to send a browser history, an Apple application .sqlite database etc. to some third party websites. If a double click does not help because there is no default association, a viewer that processes the file locally, such as sqliteviewer.app, is a safer choice.

Technical details

A generic .sqlite file represents a binary SQLite 3 database file, not a text SQL file/script. Starting at byte offset 0, it begins with 16-byte "SQLite format 3\0" file signature: 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00. Since its initial appearance in June 2004 along with version 3.0.0 of SQLite library, the file format did not change and continued being described as "SQLite format 3". Currently, format #4 is used as the schema format for SQLite database files.

Database header is stored in first 100 bytes of page 1. It describes such parameters as page size, file format write-version, file format read-version, reserved bytes per page, max/min embedded-payload fractions, min/maximum leaf payload fractions, change-counter for the file, database pages number, first freelist trunk page address, pages number in freelist, schema cookie, format number, default page cache size, largest root btree page number, database text encoding number, user version, vacuum flag, application ID, version valid for number, and SQLite version.

Storage in .sqlite is based on pages with possible page sizes equal powers of two in range 512…65536 bytes (commonly used is 4096); table and indexes in .sqlite file are stored as B-trees, overflow pages contain the overflowed row payload or index entries, freelist pages store deleted space information and auto-vacuum pages contain a list of pointers for the database page.

SQLite databases can contain UTF-8, UTF-16LE or UTF-16BE text encoding. Each cell value stored in SQLite file corresponds to SQLite dynamic typing model and uses NULL, INTEGER, REAL, TEXT and BLOB storage classes; thus, the declared column type does not define precisely the number of data bytes stored.

Compressive features are not built into .sqlite format. SQLCipher uses database page level encryption and hides SQLite visible header from reading by default - it should explicitly use "plaintext-header" to leave header unprotected. Journaling will likely create the sidecars called like input.sqlite-journal, input.sqlite-wal, and input.sqlite-shm that will store changes committed before truncating of an unclean .sqlite file. Application MIME type is usually "application/vnd.sqlite3", "application/x-sqlite3" can be met on older system; maximal theoretical capacity is about 281TB with page-size=64KiB, but usual SQLite file sizes are from some kilobytes to some gigabytes.

How to convert .SQLITE files

A consistent .sqlite file is first to be made via SQLite backup interface, via ".backup" sqlite3 shell command or via vacuum into command, before migration. In order to make a portable .sql export (to save in source control, move around), execute sqlite3 input.sqlite ".dump" > output.sql. While .sql is saved as a text file containing SQL code to create the same db structure and content, but BLOBs get special handling; still sqlite specificities should often require changes, if the .db needs to be migrated to an engine other than SQLite.

For spreadsheet-like use cases, excel or data-cleaning applications, as well as any single-table migration/export tasks, csv is good choice as sqlite3 -header -csv input.sqlite "SELECT * FROM table_name;" > table_name.csv. When export has to comply to an API contract/standard and not involve SQL code for a consumer side - json is what is required as sqlite3 -json input.sqlite "SELECT * FROM table_name;" > table_name.json.

For bigger migrations into PostgreSQL, the best option would be pgloader input.sqlite postgresql://user:password@localhost/dbname with automatic mapping to target types and creation of necessary structures at PostgreSQL side; in case of SpatiaLite - use ogr2ogr -f GeoPackage output.gpkg input.sqlite to convert .sqlite db of spatial features (geometry column supported) into .gpkg, .shp, .geojson (for web) or PostgreSQL format of PostGIS. Duckdb's sqlite extension can export some of the tables to .parquet files. CSV, JSON export formats preserve no foreign keys etc.

Convert toToolCommand / note
SQL text dump (.sql) sqlite3 sqlite3 input.sqlite ".dump" > output.sql Preserves schema and data as SQL statements; binary BLOBs are escaped, and SQLite-specific syntax may need editing for other engines.
CSV table export (.csv) sqlite3 sqlite3 -header -csv input.sqlite "SELECT * FROM table_name;" > table_name.csv Exports one query or table at a time; indexes, constraints, triggers, types, and relationships are not preserved.
JSON query result (.json) sqlite3 sqlite3 -json input.sqlite "SELECT * FROM table_name;" > table_name.json Useful for APIs and scripts; exports result rows, not the complete database structure.
PostgreSQL database pgloader pgloader input.sqlite postgresql://user:password@localhost/dbname Migrates tables and data types automatically where possible; review type mappings, autoincrement keys, indexes, and application SQL.
GeoPackage (.gpkg) from SpatiaLite GDAL ogr2ogr ogr2ogr -f GPKG output.gpkg input.sqlite Best for GIS interchange; SpatiaLite-specific functions, triggers, or custom metadata may not transfer exactly.
Parquet table (.parquet) DuckDB duckdb -c "INSTALL sqlite; LOAD sqlite; ATTACH 'input.sqlite' AS s (TYPE sqlite); COPY (SELECT * FROM s.table_name) TO 'table_name.parquet' (FORMAT PARQUET);" Good for analytics pipelines; exports selected data, not SQLite constraints or triggers.
Decrypted SQLite database from SQLCipher sqlcipher sqlcipher encrypted.sqlite "PRAGMA key='passphrase'; ATTACH DATABASE 'plain.sqlite' AS plaintext KEY ''; SELECT sqlcipher_export('plaintext'); DETACH DATABASE plaintext;" Requires the correct passphrase and cipher settings; the output is unencrypted and should be protected.

Common problems and fixes

"file is not a database" - This usually means that file does not support reading or is not an SQLite database 3.*. The file can either be SQLCipher-encrypted, compressed/renamed, a legacy version (SQLite 2.*), or have incorrect first several bytes. Check the first byte of the file using a hex editor: correct files begin with the first bytes 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 . Legacy versions of SQLite start from This file contains an SQLite 2.1 database.

"database disk image is malformed": There is corruption in your database structure. Perform the command PRAGMA integrity_check; If there is any corruption, save a copy of the current file and run .recover in the sqlite3 shell.

"database is locked": "database table is locked". Most likely, the database is held by some other transaction /WAL. You can terminate this program or work with the backup of the database. "unable to open database file". Usually, it means a problem related with a path, permissions, directory being sandboxed or read-only, missing parents' folders, issues with accessing network shares etc., and NOT the format issue. When copying .sqlite main file in the WAL mode, committed changes may be stored inside .sqlite-wal sidecar. Either copy both .sqlite and -wal + -shm files or make a full copy using SQLite's Backup API.

"no such table": Usually you used not a correct connection or attached-database has incompatible or different schema, your application has not completed all migrations, or the file does not have tables, and it is freshly created.

“file is encrypted or is not a database" within graphical interface: It means SQLCipher. Provide passphrase for decryption, KDF iteration number, SQLCipher compatibility version for your particular case.

Security considerations

Standard SQLite 3 does not contain macros and embedded executables like Microsoft Office documents do. Thus analyzing such tables via any of such applications like sqlite3 command-line interface tool, DB Browser for SQLite or SQLiteStudio would be less dangerous than opening such documents. Still a harmful file may cause issues with SQLite library itself, a GUI viewer, QGIS desktop GIS software suite, GDAL / OGR library or SpatiaLite spatial database access extensions, and code of applications, that decode BLOB values and special record structure within the table structure of SQLite databases.

Loadable extensions in SQLite are external C code libraries and not a code embedded inside the database and therefore should not be enabled at all. Moreover one should not open the unknown .dll / .so / .dylib files from the internet. The suspicious databases should be opened for analysis as read-only whenever possible. The backup files (.sqlite-journal, .wal) and sidecar (.sqlite-shm) files should be considered and inspected separately to avoid exposure of information from there.

Bare-bones databases could contain personal messages, cookie file, location data, information about personal or medical conditions, API access keys, browsing history and the information about data which used to be in a table (even if the table had been vacuumed or cleared with an app), the old data being visible from such sidecars files.

History and versions

SQLite emerged in the year 2000 when D. Richard Hipp created an SQL relational database library which executes without having another process dedicated to run a server. Release of version 2 followed by the next year, 2001 using an old file format, which although deprecated now still exists in some legacy archive systems and in long-life hardware.

SQLite 3.0.0 was released in June 2004, incorporating “SQLite format 3” file format, enhanced typing capabilities, UTF-8 and UTF-16 text encoding capability, improved and better SQL engine. SQLite 3.7.0 which was released in 2010 introduced write-ahead log system bringing along two side car files, -wal and -shm with increased reader-writer concurrency.

File format of SQLite 3 is published as documented open standard that has good longevity properties; SQLite organization states that databases built by its present releases would still be accessible decades ahead in future. Software development for SQLite comes as public domain software in several jurisdictions, however with option for getting paid commercial guarantees from the same SQLite team developing it. Encrypted format support came with release of SQLCipher where-as spatial table and GIS functionality was made possible by SpatiaLite before emergence of GeoPackage as an important common OGC standard, since .sqlite file extension is currently in use being shipped within numerous systems such as OSs itself, databases, browsers etcetera.

.db and .sqlite3 files use the same SQLite format 3 as .sqlite; whereas .sqlite and .sqlite3 have more descriptive names, .db is too vague. .db3 is the third variant, often observed in the old software for Microsoft operating systems and their mobile equivalents.

.sql files are a plain text export of all the structure and data, useful for diffs on git and easier reading, though loading into the databases takes more time, and also it does not contain a page binary structure that makes SQLite. The extensions named .duckdb point on DuckDB - a database used for efficient analytics; if one is looking for such an analysis, then choose DuckDB and leave transactions, indices and SQL constraints to SQLite (.parquet is a file format of columnar database similar to .duckdb).

.mdb and its successor .accdb store the whole content of databases with forms, reports, other Access-specific stuff. Going from .mdb and .accdb to SQLite means losing Access support for simple applications without its extra services. .gpkg file type corresponds to OGC GeoPackage files. It uses SQLite format, so use SpatiaLite for the geographical operations with SQLite and .gpkg for OGC GIS exchange. .mbtiles are the other extension of SQLite databases, useful for exporting tile maps.

Comments (0)

Replying to

No comments yet. Be the first to share your experience with this file type.