← All text tools

SQL formatter

Format SQL queries for MySQL, PostgreSQL, SQL Server, SQLite, Oracle and more.

  • Free
  • No sign-up
  • Works on any device

About SQL formatter

Paste a long one-line query and get it laid out with uppercase keywords, indented clauses and one column per line. Choose a dialect such as MySQL, PostgreSQL, SQL Server, SQLite or Oracle so dialect-specific syntax is handled. Formatting makes joins and subqueries far easier to review.

How to use SQL formatter

  1. Paste your SQL query.
  2. Choose the dialect, such as MySQL, PostgreSQL or SQL Server.
  3. Copy the neatly indented query.

Why use this tool?

Also known as

Frequently asked questions

Does formatting SQL change what it does?

No. Only whitespace and keyword case change, so the query returns the same results. It just becomes easier to read and review.

Why choose a dialect?

Each database has its own keywords and quoting rules. The right dialect makes sure special syntax is recognised and laid out correctly.

Can I format several statements at once?

Yes. Separate statements with semicolons and each is formatted in turn. Keep the semicolons so the boundaries stay clear.

Is SQL formatter free?

Yes. SQL formatter on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put SQL formatter on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools