SQL Formatter & Minifier
Paste a SQL query to have it automatically formatted for readability. Choose the dialect, indent width, and keyword case. Click "Minify" to collapse it back to a single line. To format JSON query results, try the JSON Formatter as well.
🔒 Runs in your browser · Your data is never sent to a server
Notes
- Keywords and quoting differ between dialects. Select the dialect that matches your database.
- Formatting only changes appearance (whitespace, line breaks, indentation and keyword case). It does not change what the query does.
- SQL with syntax errors may fail to format and show an error.
Glossary
SQL dialect
Syntax differences between database products such as MySQL, PostgreSQL, and SQLite — for example, the quote character used for identifiers (` or ") — so choosing the right dialect keeps formatting accurate.
Minify
Stripping line breaks, indentation, and comments so a SQL query is represented on a single line with minimal whitespace — useful when embedding a query in logs or code.
Keyword case
Whether reserved words like SELECT, FROM, and WHERE are shown in uppercase, lowercase, or left exactly as typed.
FAQ
Can I choose a SQL dialect such as MySQL or PostgreSQL?
Yes. Pick the dialect that matches your database, since keywords and quoting rules differ between them.
Does formatting change what the SQL does?
Only whitespace, line breaks, indentation and keyword casing change. The meaning is unchanged, and string literal contents are left alone.
Is my query sent to a server?
No. Formatting and minifying happen in your browser, so your SQL is never uploaded.
Share this page
