Skip to content

Free SQL Formatter

Format SQL queries for readability. Completely free, with no sign-up and no upload.

  • 100% free
  • No sign-up
  • No watermark
  • Works in your browser

Also called: SQL beautifier, format SQL query, SQL pretty print.

About SQL Formatter

Turn a long one-line SQL query into something you can read. Paste your SQL and it is laid out with each clause on its own line, tidy indentation and keywords in the case you choose. It knows the details of PostgreSQL, MySQL, SQL Server, Oracle, SQLite, BigQuery and other dialects. It all happens in your browser and your queries are never uploaded.

How to use SQL Formatter

  1. Paste your SQL, press Open file, or press Sample.
  2. Choose your SQL dialect, the indentation and the keyword case.
  3. Read the formatted result. It updates as you type.
  4. Press Copy or Download.

Tips and good to know

  • Pick the dialect that matches your database. Quoting rules and special syntax differ, and the wrong one can give an error or odd layout.
  • Several statements separated by semicolons are formatted one after another.
  • Formatting only changes spaces and line breaks (and keyword case if you ask). The query runs the same way.
  • Keep passwords, tokens and private data out of the queries you paste anywhere, even when a tool works locally.
  • If you get an error, check for an unclosed quote or bracket first.

Readable SQL

Consistent formatting makes queries easier to review: keywords in capitals, one clause per line (SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY) and indented conditions. Formatting never changes what a query does. When reviewing, check joins and WHERE conditions first, since missing join conditions cause accidental row multiplication.

Frequently asked questions

Is my SQL uploaded?

No. It is formatted in your browser.

Does it check that my query is correct?

No. It only checks that it can read the text. It does not know your tables or run anything.

Why does a certain keyword not change case?

Names of tables and columns are never changed, only SQL keywords.

Which databases are supported?

Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, BigQuery, Snowflake, Redshift and Spark.

Can it minify SQL?

Not at the moment. It only makes SQL easier to read.

Is SQL Formatter free?

Yes. SQL Formatter is 100% free: no sign-up, no paid plan, no trial and no limit on how often you use it. It runs in your browser, and ToolzAura is paid for by ads, so every tool stays free.

Are my files uploaded?

No. This tool runs in your browser, so your input stays on your device.

Maintained by Malik Shaheer · Last reviewed · How we test tools · Report a problem

Related tools

XML Formatter

Pretty-print XML.

Developer Tools

XML to JSON

Convert XML documents to JSON.

Developer Tools

XML Validator

Check that XML is well-formed.

Developer Tools

YAML Formatter

Tidy and validate YAML.

Developer Tools

YAML to JSON

Convert YAML to JSON.

Developer Tools

Base64 Encode and Decode

Convert text to and from Base64.

Developer Tools