SQLFormat SQL Formatter
SQL Query Formatter POSTGRES / MYSQL / SQLITE
Formatting Status
✓ Formatted SQL Query
0 chars
Raw SQL
Formatted SQL
Embed this tool on your site

Paste this where you want the tool to appear. It renders SQLFormat inside your own page — no ads in the embed, no input stored, and it links back to sqlformat.net so visitors can reach the full page.

Frequently Asked Questions

Is my query sent to a server?

No. Formatting is done in your browser, so queries containing table names, schema details, or literal data are never uploaded.

Which SQL dialects does the formatter handle?

Layout is one engine-agnostic pass: unambiguous syntax survives intact in both format and minify — JSONB path operators (#>, #>>, #-), :: casts, backtick identifiers, DISTINCT ON, ILIKE and dollar-quoting all come through character-for-character. The dialect select exists for the two spellings that mean opposite things in two engines and cannot be told apart from the text: a bare # (MySQL line comment vs PostgreSQL integer XOR) and a backslash inside single quotes (MySQL escape vs literal character in PostgreSQL and SQLite). Auto keeps the MySQL readings; pick your engine if your query uses either spelling.

Can it make unreadable legacy SQL readable?

Yes. Paste a single-line query and the formatter breaks it on clause boundaries and indents nested subqueries, which is usually enough to review. It never rewrites identifiers or logic.

Developer Sponsor / Partner
Copied to clipboard!

🧭 Pro Tips & Gotchas

What the formatter actually does

Gotchas