Compare SQL queries
See what changed between two versions of a query: before and after an edit, two migration scripts, or the SQL that two versions of an ORM generate. This compares the text of SQL; it does not connect to a database or compare schemas or data.
Format both, then compare
A query written on one line and the same query spread over twenty differ on every line. Format both sides with the same dialect, and only real changes remain: a column added, a condition changed, a join moved.
Keyword case
Set keywords to UPPERCASE or lowercase, and both sides are formatted that way, so select and SELECT are not reported as a difference.
Your dialect
Each side has its own dialect setting, from PostgreSQL, MySQL and SQL Server to BigQuery, Snowflake and DuckDB.
Find each change
Changed lines and words are highlighted, long unchanged stretches are folded, and the arrows jump from one change to the next. Both sides stay editable as the highlights follow, and Swap exchanges them.
Private: nothing is uploaded
Formatting, checking and comparing all happen in your browser. Your documents are saved in the browser's own storage on this computer, not on a server, so they never leave your device.
With your permission, we count anonymous visits (which pages and tools are used), never what you type. See Privacy.
Questions
Can it compare database schemas or table data?
No. It compares the text of SQL, such as two queries or two migration scripts. Comparing live databases needs a tool that connects to them.
How do I compare two queries?
Paste one on each side, choose the dialect, then Format both. Changed lines and words are highlighted.
Is my data uploaded anywhere?
Your documents aren't: everything runs in your browser, and they are saved on your computer, in the browser's storage for this site. With your permission we count anonymous visits, never their content.
More tools
- Formatter & Converter for JSON, YAML, XML, SQL
- JSON Diff – Compare Two JSON Files Online
- YAML Diff – Compare Two YAML Files Online
- TOML Compare – Compare Two TOML Files Online
- CSV Compare – Compare Two CSV Files Online
- XML Diff – Compare Two XML Files Online
- SQL Formatter & Beautifier
- PostgreSQL Formatter & SQL Beautifier
- MySQL Formatter & SQL Beautifier
- Online Diagram & Flowchart Editor
- UUID, Password, Hash & Secret Key Generators