SQLite Diff

Compare two SQLite schemas in your browser, or compare two .db files row by row. Schema comparison is free and needs no account.

Compare two SQLite schemas

Runs entirely in your browser — nothing is uploaded
Original
+ Modified
Paste SQL into both panes to see the difference instantly.

Two kinds of SQLite comparison

“Diff two SQLite databases” usually means one of two quite different things, and it is worth knowing which you need.

Schema comparison answers “is the structure the same?” — tables, columns, types, indexes, triggers and views. This is the common case when an app works on one device and fails on another, or when a migration may not have run. Export the DDL from each database and compare the text using the tool above.

Data comparison answers “did the rows change?” That needs both database files to be read and their tables walked row by row. Our database comparison feature does this and reports added, removed and modified rows per table.

Getting the schema out of a .db file

The sqlite3 shell is the quickest route. Open each database and dump its structure:

sqlite3 before.db .schema > before.sql
sqlite3 after.db  .schema > after.sql

Then paste the contents of each file into the two panes above. If the two schemas were generated by different tools, turn on “Ignore whitespace” so formatting differences do not drown out the real structural changes.

Comparing two .db files without installing anything

Nearly every tool for this is a desktop application: SQLite Compare, KS DB Merge Tools, the various App Store and Microsoft Store offerings, and SQLite’s own sqldiff command-line utility. They are capable tools, and if you already have one installed it will probably do the job.

The gap they leave is the situation where installing is the problem — a locked-down work laptop, someone else’s machine, a one-off check you don’t want to add software for. Drop both files into the tool above and the comparison runs inside the browser tab, using SQLite compiled to WebAssembly. Nothing is uploaded, which you can verify yourself in the network tab rather than taking our word for it.

Where the desktop tools stay ahead: they merge as well as compare, they generate synchronisation scripts, and they have no practical file size ceiling. This page compares and reports; it does not write your migration for you.

Where SQLite schemas drift in practice

On mobile especially, SQLite schema drift is a common and hard-to-diagnose class of bug. A Room or Core Data migration that worked on a fresh install behaves differently on a device that upgraded through three earlier versions. Users who skipped a release end up on a schema path nobody tested. Comparing the schema from an affected device against a clean install is usually the fastest way to see what actually differs.

Frequently asked questions

How do I diff two SQLite databases?+

There are two approaches. To compare schemas, run ".schema" in the sqlite3 shell against each database and paste the two outputs into the tool on this page — that is free and needs no account. To compare the actual rows inside two .db files, use the database comparison feature, which reads both files table by table.

How do I export a SQLite schema to compare it?+

Open the database with the sqlite3 command-line shell and run .schema, or run "SELECT sql FROM sqlite_master WHERE type = 'table';". Both produce the DDL text you can paste into the comparison panes.

What is the difference between this and the sqldiff utility?+

sqldiff is SQLite's own command-line tool. It reads two .db files directly and prints the SQL statements that would turn the first into the second. It is excellent, and if you already have it installed it is often the fastest option. This page is for when you want to compare schema text in a browser without installing anything, or want a visual side-by-side view.

Can I compare two .db files without installing anything?+

Yes. Drop both files in and the comparison runs inside your browser using SQLite compiled to WebAssembly. The files are never sent anywhere — you can confirm that in your browser's network tab. Every other option for this job is a desktop application you have to download and install first.

Is it safe to compare a production database here?+

On the free plan the files never leave your machine, so there is nothing to trust us with. Paid plans compare much larger databases on our servers, which does mean uploading — that is stated plainly at the point where it applies, and those files are deleted when the comparison finishes.

Can I compare a SQLite database against a MySQL or Postgres one?+

Only at the text level. If you export DDL from each and paste both in, the comparison will show the textual differences, but dialect differences in type names and syntax will show up as changes even where the intent matches.