SQL Formatter
Pretty-print SQL with clauses on their own lines. The result updates as you type.
Input
Convert to
Output
Private by design
This conversion runs entirely in your browser. Your text is not sent to a server.
Tip
SQL formatting only rewrites whitespace and keyword layout. XML must be well-formed or you will see an error.
How to convert with SQL Formatter
Paste a SQL query or XML document.
The formatted result updates as you type — nothing is uploaded.
Use Convert to to switch between SQL and XML formatters.
Copy the result. Nothing is executed against a database.
When should you use it?
SQL
Put clauses on their own lines so a long query is readable.
XML
Pretty-print a document before you inspect or convert it.
Review
Format locally before you paste into a ticket or review.
Stays here
Queries and documents never leave this tab.
Your text stays private.
SQL and XML formatting run entirely in your browser.
About formatting SQL and XML in the browser
SQL Formatter rewrites whitespace and keyword layout so SELECT / FROM / WHERE are readable. It does not execute the query and does not talk to a database. XML Formatter indents well-formed documents; malformed XML shows an error instead of inventing tags. Convert to switches between SQL and XML formatters.
Worked example: a one-line SELECT with several JOINs becomes clauses on their own lines. A nested XML config becomes an indented tree. This is not a SQL dialect validator and not an XML schema checker.
Related: XML ↔ JSON when you need objects, YAML ↔ JSON for configs, JSON Formatter for JSON. Nothing is uploaded. Keep production queries and documents off shared machines.
Related developer tools
XML Formatter
Pretty-print XML with indentation in your browser. The result updates as you type.
XML ↔ JSON Converter
Convert XML documents to JSON, or JSON objects to XML. The result updates as you type.
JSON Formatter
Pretty-print JSON with indentation, optional key sorting, and minify. The result updates as you type.
HTML Formatter
Pretty-print or minify HTML in your browser. The result updates as you type.
SQL Formatter examples
Query
SQL and XML
SQL Formatter FAQ
Yes. Paste a query into SQL Formatter. Clauses like SELECT, FROM, and WHERE indent locally as you type. Export saves a .sql file.
It only rewrites whitespace and keyword casing for readability. It does not execute SQL or connect to a database.