RichScriptsAll tools ↗
FREE DEVELOPER TOOL

SQL Formatter

Readable queries in your preferred SQL dialect.

✓ Runs in your browser✓ No account needed✓ No input stored

Input & settings

Result

How to use it

  1. 1Paste your query

    One statement or a long script.

  2. 2Choose the dialect

    Standard SQL, PostgreSQL, MySQL or SQL Server, so keywords and quoting are treated correctly.

  3. 3Copy the formatted SQL

    Indentation and line breaks make the structure easy to read and review.

Good to know

Formatting only

The query is never executed and no database is contacted.

Not a validator

Formatting does not confirm the query is correct for your schema or dialect.

Comments are preserved

Your notes stay where you put them.

Nothing is uploaded

The SQL stays in your browser, which matters when queries contain real values.

Common uses

  • Making a generated query readable before review
  • Tidying SQL pasted from an ORM log
  • Preparing a query for a pull request or ticket
  • Comparing two long queries side by side
  • Teaching or documenting a join

Questions

Does this run my SQL?

No. It only reformats the text. Nothing is connected to a database and nothing is executed.

Which dialects are supported?

Standard SQL, PostgreSQL, MySQL and SQL Server. Pick the closest one so quoting and keywords are handled properly.

Is it safe to paste a query with real values?

The formatting happens in your browser and nothing is sent anywhere. Follow your own policy for handling production data.

Can it make my query faster?

No. Formatting changes whitespace only; the query plan is unchanged.

How it works

Formatting does not execute SQL or verify that a query is valid for your database. Review queries before running them.