SQL Formatter
An SQL formatter pretty-prints SQL queries in your browser. Paste a SELECT, INSERT, UPDATE, or DDL statement, format it locally with indentation and keyword casing, then copy the result. Nothing is uploaded, stored in localStorage, or sent to a remote formatter API. This page tidies query text for reading and review — it does not execute SQL against a database.
Paste a SQL query — SELECT, INSERT, UPDATE, DELETE, or common DDL — and format it locally for readable indentation and consistent keyword casing. Closing the tab drops the workspace; we do not write the query to localStorage or send it to a formatter API. This page is a SQL beautifier / pretty-printer for text you already have, not a database client and not a query runner.
Dialect presets cover common SQL families (e.g. standard SQL, PostgreSQL, MySQL, SQLite, T-SQL, BigQuery) as formatter options only. Dialect choice changes how the formatter lays out keywords and identifiers; it does not connect to a server or validate against a live schema.
Changes indentation and keyword handling in the formatter. Does not connect to a server or validate a schema.
Spaces only for v1.
Applies to recognized SQL keywords, not string literals.
Paste any query text. Formatting runs in this tab with sql-formatter — layout dialect only, not a live database connection.
Output
Pretty-printed SQL will appear here.
How does the SQL Formatter work?
1. Paste SQL
Drop in a query or script fragment. An example is available from Load example.
2. Choose dialect
Pick a layout dialect (PostgreSQL, MySQL, etc.). This only changes formatting rules in the tab.
3. Format locally
The browser runs sql-formatter in this tab. Nothing is uploaded.
4. Copy the result
Copy readable SQL for review or a diff. Closing the tab clears the workspace.
Questions about SQL Formatter
- Does SQL Formatter upload my queries?
- No. Formatting runs in the browser with the sql-formatter library. There is no account and no server-side formatter. The text you paste stays in this tab until you clear it or close the page. We do not write it to localStorage.
- Does this page run SQL against a database?
- No. It only pretty-prints query text. There is no connection string, no execute button, and no network call to a database. Treat output as formatted text for reading — not a result set.
- Which SQL dialects are supported?
- The dialect control covers common families the formatter library supports (standard SQL, PostgreSQL, MySQL, SQLite, T-SQL, BigQuery, and any others wired in the select). Dialect changes layout and keyword handling; it does not prove the query will run on a specific server version.
- Can it fix broken or incomplete SQL?
- No. If the formatter cannot parse the text, you will see an error next to the input. Fix syntax in an editor and paste again. The page does not invent missing clauses or rewrite business logic.
- Is this the same as a SQL linter or EXPLAIN tool?
- No. This is a beautifier / pretty-printer for readable indentation and keyword casing. It does not lint style rules beyond formatting, estimate cost, or show query plans.
- What about very large scripts?
- The page is meant for typical queries and short scripts. Multi-megabyte dumps may strain the tab; keep huge migrations on a local CLI. There is no upload size limit because nothing is uploaded — the limit is browser memory and UI responsiveness.
- Does keyword uppercasing change my string literals or identifiers?
- Keyword case options apply to SQL keywords the formatter recognizes. String literals and quoted identifiers should keep their content; if a dialect option surprises you, switch dialect or choose preserve (when available) and re-copy.
- How is this different from JSON Formatter on this hub?
- JSON Formatter pretty-prints or minifies JSON with JSON.parse / JSON.stringify. SQL Formatter pretty-prints SQL query text with a SQL-aware layout engine. They share the same privacy rule (local only) but accept different languages.
What else can I open?
- JWT Token DecryptDecrypt a compact JWE locally with Web Crypto.
- JSON FormatterPretty-print or minify JSON entirely in the browser.
- UUID GeneratorMint RFC 4122 UUIDs locally with Web Crypto.
- Base64 DecodeDecode (and encode) Base64 locally as UTF-8 text.
- Cron Expression GeneratorBuild or decode a 5-field cron expression in your browser. Preview next runs locally — no signup.
- CSS FormatterPretty-print or minify CSS locally in the browser.
These tools run in your browser. Page Utils does not store, upload, or write to localStorage the keys, tokens, or text you paste. Results are a convenience aid, not legal, tax, or security advice.