The .sqlite3 File Explained thumbnail

What Is a .sqlite3 File? How to Open and View It

Files ending in .sqlite3 pop up in Python projects, Django apps, desktop programs and data exports. If you’ve never seen one, the name alone doesn’t tell you much. Double-clicking it rarely helps.

A .sqlite3 file is a SQLite database, version 3. It holds tables of data in a single file. This guide explains what that means, where these files come from, and how to open and view one in a few seconds.

What the .sqlite3 extension means

The extension has two parts:

  • sqlite means the file uses the SQLite database format.
  • 3 means it’s SQLite version 3.

SQLite 3 has been the standard since 2004. Version 2 files are extremely rare today. So a .sqlite3 file is simply a modern SQLite database. It’s the same format as most .db and .sqlite files. Only the name is different.

Developers often pick .sqlite3 because it makes the format obvious. Python’s standard library module is even called sqlite3, which helps explain its popularity.

Where .sqlite3 files come from

You’re most likely to meet a .sqlite3 file in these places:

  • Django projects. New Django projects use db.sqlite3 as the default database.
  • Python scripts. Code using the sqlite3 module often saves to a .sqlite3 file.
  • Ruby on Rails. Development databases are often stored as .sqlite3 files.
  • Desktop apps. Some apps keep their local data this way.
  • Data downloads. Research datasets and open data sometimes ship as .sqlite3.

How to open a .sqlite3 file

Method 1: In your browser (fastest)

  1. Open our free online SQLite viewer.
  2. Drag the .sqlite3 file onto the page, or click Choose file.
  3. Click a table in the sidebar to see its rows.

The viewer runs SQLite inside your browser using WebAssembly. Your file isn’t uploaded. This makes it a good choice for private data and for computers where you can’t install software.

Method 2: With the sqlite3 command-line tool

On a Mac, sqlite3 is already installed. On Linux, install it with your package manager. On Windows, download it from sqlite.org.

sqlite3 db.sqlite3

Then list the tables and look at some rows:

.tables
.headers on
.mode column
SELECT * FROM auth_user LIMIT 5;

Method 3: With a desktop app

DB Browser for SQLite and SQLiteStudio both open .sqlite3 files. They’re free and work on Windows, Mac and Linux. See our comparison of the best SQLite viewers.

How to view a Django db.sqlite3 file

Django databases follow a clear pattern. Once you open db.sqlite3, you’ll see tables like:

TableWhat it holds
auth_userUser accounts (passwords are hashed)
auth_group, auth_permissionGroups and permissions
django_migrationsWhich migrations have run
django_sessionActive login sessions
django_admin_logActions taken in the admin
yourapp_modelnameYour own models, one table each

Your own data lives in tables that start with your app’s name. A blog app with a Post model creates a table called blog_post.

To check which migrations have run, try:

SELECT app, name, applied FROM django_migrations ORDER BY applied DESC LIMIT 20;

This is useful when debugging a migration that didn’t apply.

How to view .sqlite3 files in Python

If you’re working in Python, you can read the file with a few lines:

import sqlite3

con = sqlite3.connect("db.sqlite3")
cur = con.cursor()
cur.execute("SELECT name FROM sqlite_master WHERE type='table'")
print(cur.fetchall())
con.close()

This prints every table name. For a quick visual check, though, the browser viewer is faster. You see every table and can click through rows without writing code.

Reading the data inside

After you open the file, take a moment to get oriented:

  1. Scan the table list. Names usually explain themselves.
  2. Check row counts. Large tables hold the main data.
  3. Open the Structure tab. See column types and keys.
  4. Sort and search. Click headers to sort. Use the search box to filter.

Our guide on viewing the contents of a SQLite database goes deeper into structure, joins and searching.

Listing tables in a .sqlite3 file

The quickest SQL for this:

SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;

Or in the command-line shell:

.tables

We cover more options in how to list all tables in SQLite.

Exporting data from a .sqlite3 file

  • Click Export CSV in the viewer to get a spreadsheet-ready file.
  • Click Export JSON if you need the data in code.
  • Use a query first if you only want some rows or columns, then export the result.

For step-by-step help, read SQLite to CSV or SQLite to Excel.

.sqlite3 vs .db vs .sqlite

All three are usually the same SQLite 3 format. The extension is just a label.

  • If a program expects .db, you can often rename a .sqlite3 file to .db and it will still work.
  • Renaming doesn’t convert anything. The contents stay identical.
  • Our viewer ignores the extension and checks the file header instead.

Read more about the generic .db file if you want the full picture.

Comparing two .sqlite3 files

A common task is checking what changed between two copies of a database, for example before and after a migration. A simple approach:

  1. Open the first file in the viewer and note the row counts for each table.
  2. Open the second file and compare the counts.
  3. For a table that changed, sort both by id and look at the newest rows.

For a precise comparison, the sqlite3 command line can dump both files to text with .dump, and a diff tool can compare the two dumps line by line.

Common problems

“File is not a database”

The header is missing or the file is encrypted. Check that you copied the whole file and that it isn’t a zip. See our fix guide.

“Database is locked”

Another process is using the file. Stop your Django development server or close your script, then try again. Our guide on the database is locked error explains every cause.

Data seems out of date

If you see db.sqlite3-wal next to the file, some changes may still be in the write-ahead log. Stop the app so it writes them back, then copy both files together.

Useful queries for any .sqlite3 file

Once the file is open, a handful of queries answer most questions. Paste these into the Run SQL tab and change the table names to match yours.

Count rows in a table:

SELECT COUNT(*) FROM blog_post;

See the newest rows first, assuming there’s a date column:

SELECT * FROM blog_post ORDER BY created_at DESC LIMIT 20;

Find rows that mention a word:

SELECT id, title FROM blog_post WHERE title LIKE '%sqlite%';

Check how a table was created:

SELECT sql FROM sqlite_master WHERE name = 'blog_post';

Count rows per group:

SELECT status, COUNT(*) FROM blog_post GROUP BY status;

These five patterns cover a surprising amount of day-to-day debugging. You don’t need to memorize them. Keep this page bookmarked and copy what you need.

Checking a .sqlite3 file before you deploy

Many developers use SQLite locally and a different database in production. Before you push changes, it’s worth opening your local db.sqlite3 and checking a few things:

  • Did the migration create the columns you expected? Look at the Structure tab for the changed table.
  • Are default values correct? New rows should have sensible defaults.
  • Is test data leaking? Make sure you’re not about to copy test users or fake orders somewhere real.
  • Are indexes there? If you added an index in a migration, it should appear in the Structure tab.

A quick visual check in the browser takes a minute and can save an evening of debugging.

Is it safe to share a .sqlite3 file?

Be careful. A Django database contains user emails, hashed passwords, session data and anything else your app stores. Don’t commit it to a public Git repository. Add db.sqlite3 to your .gitignore file.

When you need to inspect it, use a viewer that keeps the file on your machine, like ours.

Resetting a development .sqlite3 database

Sometimes the easiest fix for a messy local database is to start fresh. In a Django project, you can stop the server, move db.sqlite3 somewhere safe, and run your migrations again. Django creates a new empty file.

Keep the old file for a while. If you later need a record from it, open it in the viewer, find the rows, and export them. This is much easier than trying to repair a broken local database by hand.

Want the technical detail? See the official Python sqlite3 module documentation.

Frequently asked questions

Can I open a .sqlite3 file in Excel?

Not directly. Export the table to CSV first, then open that in Excel.

What’s the difference between sqlite3 the file and sqlite3 the tool?

The .sqlite3 file is a database. The sqlite3 tool is the command-line program that opens databases. Same name, different things.

Can I open .sqlite3 files on a phone?

Yes. Our viewer works in mobile browsers. Pick the file from your Files app.

How big can a .sqlite3 file be?

SQLite supports extremely large databases, far beyond what most people need. Browser viewers work best with files up to a few hundred megabytes.

Summary

A .sqlite3 file is a standard SQLite version 3 database. You’ll see it most in Python and Django projects. To open it, drop it into our online SQLite viewer, use the sqlite3 command line, or install a desktop app. Then browse tables, run queries and export what you need.

Similar Posts