Code
Beautify SQL for many dialects locally with sql-formatter.
Runs entirely in your browser
Nothing you paste is uploaded. Monaco and Prettier load on demand from this origin.
Dialect
SQL
Formatted
select id, name from users where active = 1 order by name
There is no upload endpoint — your files are processed in this browser tab. Open your network tab and check. See how it stays private.
How to SQL formatter
- Paste SQL. Paste the query you want to tidy up.
- Format. Keywords, clauses, and joins are laid out consistently.
- Copy. Copy the formatted query back into your editor.
A long query crammed onto few lines is hard to review and easy to get wrong. Formatting aligns clauses and joins so the structure of the query is obvious, which makes bugs and missing conditions easier to spot.
To actually run SQL against a CSV, use the Data Zone SQL tool (DuckDB in the browser); for other languages, use the code formatter.
Frequently asked questions
Does it work with any SQL dialect?
It formats standard SQL structure — SELECT, JOIN, WHERE, CTEs — which covers most dialects; vendor-specific syntax is preserved even if not specially styled.
Will it change my query's behavior?
No. Formatting only changes whitespace and casing for readability; the query logic is untouched.
Is my SQL uploaded?
No. It's formatted in the browser, so queries — which can reveal schema details — stay local.
Related tools
- SQL queryDuckDB in browser
- Format & minifyPrettify or minify HTML, CSS, JavaScript, TypeScript, and JSON entirely in your browser.
- JSON toolkitFormat, validate, minify, and explore JSON in a collapsible tree — all in your browser.
- Text diffCompare two blocks side-by-side with highlighted line differences.