plaintools.tools

SQL formatter

Paste SQL to pretty-print or minify it in your browser. Optional dialect keyword sets for Standard, PostgreSQL, MySQL, and SQLite. No upload. No account.

Paste SQL, then format or minify.

What this tool does

This SQL formatter tokenizes your query in the browser, preserves string literals and comments, uppercases recognized keywords when enabled, and inserts line breaks before common clauses (SELECT, FROM, WHERE, JOIN, GROUP BY, and similar). Use the dialect toggle when you want PostgreSQL-, MySQL-, or SQLite-specific keywords treated the same way. Prefer a local formatter when the query should not leave your machine.

Related tools

FAQ

What is an SQL formatter?

An SQL formatter pretty-prints SQL so keywords, clauses, and indentation are easier to read. This page runs entirely in your browser: paste a query, choose a dialect keyword set if you want, and format or minify without uploading anything.

Does this SQL formatter upload my query?

No. Formatting and minifying run in your browser with JavaScript. Your SQL never leaves this page.

Which SQL dialects does this tool support?

The dialect toggle mainly changes which keywords are uppercased and treated as clause breaks: Standard SQL, PostgreSQL (e.g. ILIKE, RETURNING), MySQL, and SQLite. It is a formatter, not a full parser or validator for every vendor dialect.

Will formatting change how my query runs?

Pretty-print and minify only reshape whitespace and keyword casing outside of strings and quoted identifiers. String literals and comments are preserved. Always review the result before running it in production.

Can I minify SQL as well as pretty-print it?

Yes. Format adds line breaks and indentation around common clauses. Minify collapses insignificant whitespace while keeping string and comment contents intact.