Developer tools
SQL Formatter and Beautifier
Free, no sign-up, works in your browser. Format messy SQL into clean, indented queries, or minify it onto one line. Works with standard SQL, PostgreSQL, MySQL, SQL Server, Oracle, BigQuery, Snowflake and more.
Formatting changes only spacing and letter case, never what the query does. Your SQL stays on your device.
How to use the SQL Formatter
- Paste your SQL or open a .sql file.
- Pick the dialect, keyword case and indent.
- Click Format, then copy or download the result.
Frequently asked questions
- Does formatting change what my query does?
- No. Only spacing, line breaks and the letter case of keywords change.
- Which databases are supported?
- Standard SQL plus PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark, DuckDB, Trino and ClickHouse.
- Why does it say it couldn't read my SQL?
- Usually a missing bracket or quote, or syntax from a different database. Try choosing the dialect your query was written for.
- Is my SQL uploaded?
- No. Your SQL is formatted on your device.
- Is the SQL Formatter free?
- Yes. It's free to use, with no sign-up and nothing to install.
Related tools
- JSON FormatterPaste JSON to check that it's valid, then format it with clear indentation or minify it to one line. If something is wrong, you see the line and column of the mistake. Your data stays on your device.
- String Escape and UnescapeEscape text so it fits safely inside a JSON, JavaScript, CSV, SQL, regular expression or XML string, or turn escaped text like \n and \" back into plain text.
- Text ComparePaste two versions of a text to see exactly what changed: removed text in pink, added text in green, side by side or inline. Compare by lines, words or characters. Both texts stay on your device.