SQL Formatter — Beautify SQL Queries Online

Format SQL for MySQL, PostgreSQL, SQL Server, SQLite, BigQuery and more, with keyword case control. Free, no sign-up, and your files never leave your device.

Free, with no sign-up and no watermark. The file is processed in your browser and never uploaded.

Paste a long, single-line query and get readable SQL with clauses on their own lines, consistent indentation and keyword casing. Choose your dialect — MySQL, PostgreSQL, SQL Server, Oracle, SQLite, BigQuery, Snowflake and more — so dialect-specific syntax is understood.

Step by step

  1. Paste SQL: One query or many separated by semicolons; or open a .sql file.
  2. Pick the dialect: Choose the database you use from Dialect.
  3. Set keyword case: UPPER, lower, or As typed.
  4. Copy the result: Copy or download query.sql.

Handy for

Code review

Make generated or minified queries reviewable.

Debugging ORMs

Format the SQL an ORM logged to understand it.

Documentation

Paste clean queries into docs and tickets.

Learning

See the structure of complex joins and subqueries.

Good to know

  • Formatting never changes what the query does — only whitespace and keyword case.

  • Multiple statements are separated by a blank line.

Questions

Does it run or validate my query?

No. It only formats text. Nothing connects to a database.

Is my data sent anywhere?

No. Everything is processed by JavaScript in your browser tab — nothing you paste or open is uploaded, logged or stored on a server. You can even use the tool offline once the page has loaded.

More Developer Tools tools

All Developer Tools tools