Compare SQL queries, schema definitions, stored procedures, and migration files side-by-side with syntax highlighting. viewdiff is a free SQL diff tool that highlights additions, deletions, and changes in your SQL code. Perfect for reviewing database changes, comparing migration versions, or auditing stored procedures. Runs 100% in your browser — your SQL never leaves your machine. Works with PostgreSQL, MySQL, SQLite, and standard SQL.
Features
SQL syntax highlighting for keywords, strings, and comments
Side-by-side and inline diff views
Compare schemas, migrations, and stored procedures
Handles DDL, DML, and DCL statements
Ignore whitespace and formatting differences
Share SQL diff via URL
Works with PostgreSQL, MySQL, SQLite, and standard SQL
100% client-side — your SQL stays private
Frequently asked questions
How do I compare two SQL queries online?
Paste the original SQL query on the left and the modified query on the right. viewdiff instantly highlights every difference — additions in green, deletions in red. No buttons to click.
Can I compare database migration files?
Yes — paste two migration files to see exactly what changed between versions. viewdiff highlights added columns, modified constraints, dropped tables, and every other change.
Does it support PostgreSQL, MySQL, and SQLite?
Yes. The syntax highlighter covers standard SQL and recognizes keywords from PostgreSQL, MySQL, SQLite, SQL Server, and Oracle.
Can I compare stored procedures?
Yes. Paste any SQL text including stored procedures, functions, triggers, views, and indexes to see differences highlighted with syntax coloring.
Is my SQL data private?
Yes — viewdiff runs 100% client-side in your browser. Your SQL queries are never uploaded to any server. Compare sensitive database schemas with confidence.
Can I compare SQL schema files?
Yes — paste CREATE TABLE, ALTER TABLE, or any DDL statements to compare schema changes side-by-side. Perfect for reviewing database migrations before deploying.
Is this SQL diff tool free?
Yes, completely free with no ads, no sign-up, and no usage limits. Compare as many SQL files as you need.
Can I ignore whitespace in SQL comparisons?
Yes — open Settings and toggle "Ignore whitespace" to hide formatting-only changes and focus on meaningful differences in your SQL code.