XML Formatter

XML Formatter

Pretty-print XML with indentation in your browser. The result updates as you type.

Free
No signup
Instant
Private
Input
0 words • 0 characters • 0 without spaces • 0 lines
Convert to
Output
0 words • 0 characters • 0 without spaces • 0 lines

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

  1. Paste a SQL query or XML document.

  2. The formatted result updates as you type — nothing is uploaded.

  3. Use Convert to to switch between SQL and XML formatters.

  4. 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.

Learn more about privacy →

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 examples

Document

Input
<note><to>Ada</to><from>Lin</from></note>
Output
<note> <to>Ada</to> <from>Lin</from> </note>

SQL and XML

ToolExampleTypical use
SQLSELECT … FROM …Read SELECT / FROM / WHERE clauses
XML<note>…</note>Indent nested elements

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.