XML Formatter
Pretty-print XML with indentation in your browser. 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 XML 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
SQL Formatter
Pretty-print SQL with clauses on their own lines. 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.
XML Formatter examples
Document
SQL and XML
XML Formatter FAQ
Paste XML into XML Formatter. Invalid XML returns an error instead of a broken document. Use Export to save a .xml file.
Yes. Use XML ↔ JSON Converter to turn XML into JSON, or JSON back into XML.