SQL formatter — pretty-print or minify
Paste a SQL query and get it formatted with uppercase keywords and clause breaks, or minified to one line. It formats in your browser (0 uploads, works offline).
How to use it
- Paste your input into the left pane.
- Choose any options above the panes.
- The result updates live on the right — Copy or Download it.
FAQ
How do I format a SQL query for free?
Paste your query and it is reformatted in your browser with no upload — keywords uppercased and major clauses (FROM, WHERE, ORDER BY) placed on their own lines. Tick minify to collapse it back to a single line.
Does formatting change my query's meaning?
No — only spacing, case and line breaks change. The query runs exactly the same; formatting just makes it readable.
Is my query uploaded?
No. Formatting is local and nothing is stored; it works offline, so a query against production data stays on your machine.
Does it work for all databases?
It handles standard SQL keywords and clauses, which covers most PostgreSQL, MySQL and SQLite queries. Vendor-specific syntax is passed through unchanged.
Limits
A pragmatic formatter, not a parser — it uppercases known keywords and breaks major clauses. Deeply nested subqueries are not specially indented.
Related
The CSV-to-SQL tool generates statements; the JSON formatter handles JSON.
Bookmark this page (Ctrl+D, or ⌘D on Mac) or install the app — it works offline the next time you need it.