SQL Formatter

Beautify and indent SQL queries, in your browser.

Runs locally in your browser
Formatted SQL No signup · local processing

Paste SQL to format and indent it

Paste a query on the left, pick your dialect, and click Format. Keywords line up and clauses break onto their own lines — all in your browser, nothing uploaded.

Runs entirely in your browser

Format SQL queries, locally

Paste a SQL query and this tool re-indents it into a clean, readable form — keywords lined up, clauses on their own lines, and consistent spacing. Pick the dialect that matches your database so it recognizes the right keywords and syntax, choose your indent width, and set keyword casing to upper, lower, or leave it as written. Queries often contain sensitive table and column names, so it matters that everything is formatted entirely in your browser and never uploaded to any server.

Common questions

Which SQL dialects are supported?

Standard SQL plus PostgreSQL, MySQL, SQL Server (Transact-SQL), SQLite, and BigQuery. Choosing the right dialect helps the formatter recognize dialect-specific keywords and quoting.

Does it change what my query does?

No. It only reformats whitespace, indentation, and optionally keyword casing. The tokens and structure of your query are preserved — it is a pretty-printer, not a rewriter.

Can I control indentation and keyword case?

Yes. Set the indent to 2 or 4 spaces or a tab, and choose whether keywords are uppercased, lowercased, or left exactly as you typed them.

What if my SQL has a syntax error?

The formatter is lenient and will still reformat most queries. If it genuinely cannot tokenize the input it shows an error message instead of mangling your query.

Are my queries uploaded anywhere?

No. Queries are formatted entirely in your browser tab using a formatting library loaded on your device. Nothing is sent to a server, which matters because SQL often exposes real table and column names.