SQL Diff Checker
Check two SQL queries or scripts for differences. Paste both sides and every added, removed and changed line is highlighted straight away.
Check two SQL statements
What a SQL diff checker is for
Most SQL changes are small edits to something long — an extra join condition, a column added to a SELECT list, a WHERE clause that quietly gained an AND. Reading two 200-line queries side by side and spotting that by eye is slow and unreliable. A diff checker does the comparison mechanically so you can see the change rather than hunt for it.
Common cases this handles well
Reviewing a query change. Someone edited a report query and the numbers moved. Diff the old and new versions to find the clause responsible.
Comparing environments. Dump a stored procedure or view definition from staging and from production, paste both in, and see where the two have drifted apart.
Checking a migration. Compare the schema your migration was written against with the schema actually deployed, before the migration runs rather than after.
Reformatting safely. After running a query through a formatter, diff it against the original with “Ignore whitespace” enabled to confirm the formatter only moved whitespace and did not change logic.
Why the results stay on your machine
Query text often contains table names, column names, business logic and sometimes literal values from real records. Pasting that into a site that uploads it to a server is a genuine risk, and one that is easy to avoid: this checker does the comparison in your browser with JavaScript. No request is made, so there is nothing to leak, log or retain.
Frequently asked questions
How do I check the difference between two SQL queries?+
Paste the first query into the left pane and the second into the right pane. Differences are highlighted immediately — removed lines in red on the left, added lines in green on the right. Nothing is submitted or uploaded.
Why does the checker show a whole line as changed when I only edited one word?+
The comparison works line by line, which is how git and most code review tools work. If you reformatted a query, turn on "Ignore whitespace" so that indentation and spacing changes are filtered out and only real differences remain.
Can I check two queries that differ only in keyword casing?+
Yes. Enable "Ignore case" and SELECT and select will be treated as identical. This is useful when comparing a formatted query against one written in a different house style.
Does the checker validate SQL syntax?+
No. It compares text and reports what changed. It does not parse or execute your SQL, which is why it works safely with any dialect and with fragments that are not runnable on their own.