Beautify, format, and minify SQL queries. Instant client-side formatting.
SQL · format · beautify · minify
Pretty-print messy SQL into readable clauses, or minify a query into a compact line — entirely in your browser. Paste a long SELECT from a log or ORM dump, format it, and copy it back into your editor without uploading query text to a third-party server.
SQL is easier to review when keywords, joins, and nested subqueries are indented consistently. Production logs and APM tools often emit single-line queries that are painful to read. This formatter rewrites whitespace for human scanning and can compress formatted SQL back down when you need a single line for a ticket or config field.
Formatting does not execute SQL against a database. It does not validate dialect-specific grammar for Postgres vs MySQL vs SQL Server. Treat output as a readability aid, then run EXPLAIN and tests in your real engine.
SELECT u.name, o.total FROM users u JOIN orders o ON u.id = o.user_id WHERE o.created_at > '2024-01-01' ORDER BY o.total DESC LIMIT 10;
Beautified layout typically separates SELECT lists, JOIN lines, and ORDER BY so each clause is scannable. Exact indentation depends on the formatter rules on this page.
Dialect tip: Identifiers, quoting (" vs `), and functions differ across engines. Formatting whitespace is portable; copying a MySQL-only function into Postgres still fails at runtime.
No. It only reformats text. Connect to your database with a real client to execute.
Whitespace outside string literals should not change semantics. Always re-check string contents and comments if something looks off.
No — processing is local in the browser. Privacy Policy.