/
Database

3 Free Online Database Tools

These 3 tools handle the SQL chores that sit between an editor and a database client. SQL Formatter / Beautifier takes a query that arrived as one unreadable line — out of a slow-query log, an ORM, or a bug report — and lays it out with clauses on their own lines and subqueries indented inside their parentheses, or minifies it back onto one line for a config file or connection string. It reads the dialect from the markers in your SQL and works for MySQL, PostgreSQL, SQLite, SQL Server, and Oracle. SQL Schema Diff compares two CREATE TABLE definitions column by column — which columns exist on only one side, which changed type, nullability, or default, which constraints and indexes are missing — and writes the ALTER statements that bring one schema in line with the other, in the correct per-dialect syntax. Both run entirely in your browser, so a schema or a query carrying table names and business logic never leaves your machine.

All 3 Database tools

What you can do with these database tools

Two jobs that come up whenever you are reading unfamiliar SQL or reconciling two environments.

  • Format SQL — turn a one-line query into readable, indented SQL with clause-per-line layout, configurable keyword case, and syntax highlighting in both panes.
  • Minify SQL — squeeze a statement back onto a single line for a config value or a connection string, keeping optimizer hints and version-gated comments intact.
  • Detect the dialect — automatic detection for MySQL, PostgreSQL, SQLite, SQL Server, and Oracle, shown beside the result so you can overrule it.
  • Diff two schemas — compare two CREATE TABLE definitions and see every column, type, nullability, default, constraint, and index that differs.
  • Generate migrations — emit the ALTER statements to sync either side, with MySQL MODIFY COLUMN, PostgreSQL ALTER COLUMN … TYPE, Oracle MODIFY, and SQL Server ALTER COLUMN syntax.

A formatter and a diff are not a validator or a migration runner

Both tools describe the shape of your SQL, not its correctness or its consequences. SQL Formatter will happily lay out a half-written query — output that indents somewhere unexpected usually points straight at a parenthesis or a quote you forgot to close, but it does not check that the statement runs. SQL Schema Diff writes accurate ALTER statements for the structural change it sees, but it cannot know your data, your locking constraints, or your deployment order: on a large MySQL or PostgreSQL table an ALTER can lock or rewrite the whole thing, so check what your version does for that specific change before running it. Treat the generated SQL as a first draft to read, run against a development database first, and never run a generated statement unread.

Related categories

Frequently asked questions

6

Yes. Both are free with no account, no usage limits, and no paywalled features, and they keep working offline once the page has loaded.

No. The SQL Formatter and SQL Schema Diff parse and transform your SQL in the browser with JavaScript. Nothing you paste is transmitted or logged, which makes them safe for queries and schemas that carry table names or business logic.

MySQL, PostgreSQL, SQLite, SQL Server, and Oracle, plus a generic standard-SQL mode. The formatter auto-detects the dialect from markers in your SQL and reports which it picked; the schema diff emits ALTER syntax specific to the dialect you choose.

No, and that is deliberate — you are usually formatting a query that is half-written. Invalid SQL still formats rather than being rejected, though unbalanced parentheses and unterminated strings do get flagged, and output that indents unexpectedly is a strong hint about where the problem is.

Treat them as a first draft. They are accurate about the structural change but cannot account for your data volume, locking behaviour, or deployment order. Review them, run them against staging first, and check what an ALTER does on a large table in your database version.

Yes. The SQL Formatter does both directions — beautify a one-line query into indented SQL, or minify a multi-line statement back onto one line. Minifying strips comments except optimizer hints and MySQL version-gated comments, which are executable and always kept.