SQL Formatter
Format and beautify SQL queries, in your browser.
Recommended next steps
Related tools
Format, validate, and beautify JSON, in your browser.
Format, indent, and validate XML, in your browser.
Test a regular expression against text and see matches and capture groups.
Frequently asked questions
No. Formatting and minifying run entirely in your browser with JavaScript. Your query never leaves the page and isn't sent to a server.
You can choose Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, Snowflake, Redshift, SQL Server (T-SQL), Oracle (PL/SQL), or Spark SQL. Picking the dialect that matches your database helps the formatter handle dialect-specific keywords and syntax correctly.
Format re-indents your query across multiple lines so clauses like SELECT, FROM, and WHERE are easy to scan. Minify collapses the query onto a single line with single spaces, which is handy for pasting into a log, a one-line config, or a string literal.
It re-formats syntactically valid SQL and can optionally upper- or lower-case keywords, but it doesn't rewrite logic or connect to a database. If your SQL can't be parsed it shows a clear error instead of mangling it — that usually points to a typo or the wrong dialect.
Last updated 2026-06-23.