SQL Formatter & Beautifier

Format SQL queries with uppercase keywords and clear indentation for SELECT, JOIN, WHERE and subqueries.

InstantPrivate — runs in your browserFree, no sign-up

Your details

Keywords
Indent
Layout

Result

How to use

  1. 1

    Paste one or more SQL statements.

  2. 2

    Choose keyword case and indent size.

  3. 3

    Copy the formatted query back into your editor.

Questions

Which SQL dialects are supported?

The formatter works with standard SQL used by MySQL, PostgreSQL, SQL Server, Oracle, SQLite and BigQuery. It only changes whitespace and keyword case — your table names, strings and comments are left exactly as written.

Does it check whether my SQL is valid?

No — it formats the query but does not run or validate it against a database. Unbalanced quotes or brackets will show up as odd indentation.

Why uppercase keywords?

Writing SELECT, FROM and WHERE in capitals is a long-standing convention that makes the query structure easy to scan. SQL itself is not case-sensitive for keywords.

About this SQL Formatter tool

SQL Formatter & Beautifier — Format SQL queries with uppercase keywords and clear indentation for SELECT, JOIN, WHERE and subqueries. It is one of 200 free tools on namasivayam.in, made by software engineer Namasivayam Vadivelan for everyday use in India.

Everything is calculated instantly in your browser: nothing you type or upload is sent to any server, there is no sign-up, and it works on mobile and desktop. Paste one or more SQL statements.

Related reading

Articles that go with this tool

All articles →

Related tools

More developer tools you may like

All 200 tools →

Results are estimates to help you plan. They are not financial, tax or medical advice.