Runs 100% in your browser — nothing is uploaded
Formatters & Minifiers

SQL Formatter / Beautifier

Beautify and standardize SQL queries across MySQL, PostgreSQL, SQLite, BigQuery, and Spark dialects.

SQL Formatter / Beautifier
Client-side

About this tool

The SQL Formatter takes minified, copy-pasted, or inconsistently indented SQL and reformats it into clean, readable output with proper keyword casing and consistent indentation. Paste a query from a log file, an ORM debug dump, or a colleague's Slack message and get back SQL you can actually read and review.

Six dialects are supported — Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, and Spark — each with its own keyword set and quoting conventions handled correctly by the underlying sql-formatter engine. You can choose uppercase, lowercase, or preserved keyword casing to match your team's style guide, and pick 2-space or 4-space indentation.

Formatting runs entirely in your browser using the sql-formatter JavaScript library — no query text, table names, or embedded literals are ever sent to a server. This matters when working with production queries that may contain sensitive filter values or internal schema names. Open your browser's Network panel while using it and you will see zero outbound requests.

Common uses: cleaning up SQL before a code review, formatting dynamically generated queries from an ORM for debugging, standardizing SQL style across a team, and making deeply nested subqueries and JOINs readable at a glance.

FAQ

Does this tool send my SQL query to a server?
No. Formatting runs entirely in JavaScript inside your browser tab using the sql-formatter library. Open your browser's Network panel while using it — you will see zero outbound requests.
Which SQL dialects are supported?
Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, and Spark SQL. Each dialect has slightly different keyword sets and quoting rules, which the formatter accounts for automatically based on your selection.
What does "keyword case" control?
It controls whether reserved words like SELECT, FROM, and WHERE are output in uppercase, lowercase, or left exactly as you typed them ("preserve"). Uppercase is the traditional SQL style convention; many modern teams prefer lowercase.
Will this validate that my SQL is correct?
No — it formats syntax structure but does not check whether tables or columns exist, or whether the query is semantically valid against your database schema. It will still reformat queries with minor syntax issues where possible.
Can I format very long queries with many JOINs and subqueries?
Yes. The formatter handles deeply nested subqueries, CTEs, and multi-table JOINs, indenting each level consistently so the query structure is easy to follow.