SQL Formatter
Beautify SQL queries with dialect-aware formatting for MySQL, PostgreSQL, SQL Server, Oracle, SQLite and more.
Runs in your browserSQL → SQL
Loading tool…
Example
select id, name from users where active = 1 order by name
SELECT id, name FROM users WHERE active = 1 ORDER BY name
How to use the SQL Formatter
- Paste or type your SQL into the input area, or open a file from your device.
- Adjust the options above the editor if the tool offers any.
- Review the SQL result, then copy it or download it as a file.
Privacy and limitations
- Your data is processed on your device and is not uploaded to any server.
Frequently asked questions
Why should I pick a dialect?
Dialects differ in quoting, operators and keywords (for example backticks in MySQL, :: casts in PostgreSQL, [brackets] in SQL Server). Choosing the right one avoids parse errors and keeps those constructs intact.
Related converters
SQL Syntax HighlighterHighlight SQL queries with coloured keywords, strings and numbers, exported as embeddable HTML.SQL MinifierCompress SQL onto one line by removing comments and extra whitespace, without touching string literals.SQL to JSON ConverterConvert SQL INSERT statements into JSON records. Handles multi-row VALUES, quoted strings, NULL and booleans.SQL to CSV ConverterExtract rows from SQL INSERT statements into CSV, ready for Excel or another database import.SQL to XML ConverterConvert SQL INSERT statements into XML, with one element per row and one child element per column.SQL to YAML ConverterTurn SQL INSERT statements into YAML records, for fixtures and seed files.SQL to HTML TableRender rows from SQL INSERT statements as an HTML table, with one table per database table and a safe preview.