1. Home
    2. Data Converters (JSON/CSV)
    3. XML Formatter

    XML Formatter & Validator

    Paste XML to pretty-print, minify or check that it is well-formed. Attributes, CDATA and comments are kept.

    Indent
    XML input
    Formatted XML

    Everything runs in your browser. Your data never leaves your device.

    Quick answer

    How do I format XML online?

    Paste your XML into the left box. The Toolzzz XML Formatter parses it with your browser’s XML parser, then re-indents every element with 2 spaces, 4 spaces or tabs, or minifies it. If the XML is not well-formed, you see the parser’s error message.

    • Pretty print with 2 spaces, 4 spaces or tabs
    • Minify XML to one line
    • Validates that XML is well-formed
    • Keeps attributes, CDATA and the declaration
    • Option to keep or remove comments
    • Short text stays on one line with its tag
    • Counts the elements
    XML Formatter & Validator: indent and validate xml in your browser
    XML Formatter on Toolzzz: indent and validate xml, free and private.
    How it works

    How to format XML in 3 steps

    The formatted XML appears instantly.

    1. Paste your XML

      Paste it or press Upload to open an .xml file.

    2. Pick the indent

      Choose 2 spaces, 4 spaces, Tab or Minify, and whether to keep comments.

    3. Copy or download

      Press Copy, or Download to save an .xml file.

    How to format XML in 3 steps in three steps: paste your xml, pick the indent, copy or download
    How to format XML in 3 steps in three steps.
    Use cases

    What the XML formatter helps with

    Reading SOAP and API replies

    Make one-line XML responses readable.

    Finding errors

    Spot unclosed tags and bad characters.

    Sitemaps and RSS

    Check sitemap.xml and feed files.

    Config files

    Tidy Maven, Android and .NET config files.

    Office files

    Read the XML inside .docx and .xlsx packages.

    Minify for transfer

    Shrink XML before sending it.

    Any device

    How to use the XML Formatter on Windows, Mac, iPhone and Android

    No app to install. The tool works in any modern browser, so the steps are almost the same everywhere.

    On Windows

    1. Open toolzzz.com/xml-formatter/ in Chrome, Edge or Firefox.
    2. Paste (Ctrl+V) your XML into the left box, or press Upload to open a file.
    3. Choose an indent size, or Minify.
    4. Press Copy to put the result on your clipboard, or Download XML to save it. Files go to your Downloads folder.

    On Mac

    1. Open toolzzz.com/xml-formatter/ in Safari or Chrome.
    2. Paste (Cmd+V) your XML into the left box, or press Upload to open a file.
    3. Choose an indent size, or Minify.
    4. Press Copy to put the result on your clipboard, or Download XML to save it.

    On iPhone and iPad

    1. Open toolzzz.com/xml-formatter/ in Safari.
    2. Touch and hold the box, tap Paste to add your XML into the left box, or tap Upload to open a file.
    3. Choose an indent size, or Minify.
    4. Tap Copy to put the result on your clipboard, or Download XML to save it. Downloads appear in the Files app.

    On Android

    1. Open toolzzz.com/xml-formatter/ in Chrome.
    2. Long-tap the box and tap Paste to add your XML into the left box, or press Upload to open a file.
    3. Choose an indent size, or Minify.
    4. Tap Copy to put the result on your clipboard, or Download XML to save it. Downloads go to the Downloads folder.
    Comparison

    Toolzzz vs. other online converters

    FeatureToolzzz XML FormatterTypical online converters
    PriceFree, no limitsFree tier, then paid plans
    Where your data goesStays in your browserOften uploaded to a server
    Sign-upNot neededSometimes needed to download
    SpeedConverts as you typeUpload, wait, then download
    Size limitOnly your device memoryOften 1 to 10 MB on free plans
    Error messagesLine and column shownOften just "invalid input"

    "Typical" describes common limits of free online services. Plans and limits differ between sites.

    Why Toolzzz

    Why convert data with Toolzzz

    Private by design

    Your data is converted by JavaScript in this tab. Nothing is sent to Toolzzz or anyone else.

    Instant results

    The output updates while you type or paste. There is no queue and no waiting.

    Clear errors

    Invalid input is flagged with the reason and, where possible, the exact line and column.

    Copy or download

    Copy the result in one click or save it as a ready-to-use file.

    Works everywhere

    Windows, Mac, Linux, iPhone, iPad and Android. Any modern browser will do.

    Free forever

    No account, no limits, no watermark and no trial period.

    Pro tips

    Tips for the best result

    • An & in text must be written as &. A bare & makes XML invalid.
    • Every opening tag needs a matching closing tag, or a self-closing form like <br/>.
    • Tag names are case-sensitive: <Item> and <item> are different.
    • There must be exactly one root element.
    • Convert spreadsheet data into XML with CSV to XML.
    Glossary

    Key terms explained

    Well-formed XML
    XML that follows the syntax rules: one root, matched tags, quoted attributes and escaped characters.
    CDATA
    A section whose content is treated as plain text, not markup.
    XML declaration
    The optional first line, such as <?xml version="1.0" encoding="UTF-8"?>.
    FAQ

    Frequently asked questions

    Is the XML formatter free?

    Yes. It is free with no limits.

    Is my XML uploaded?

    No. Parsing and formatting happen in your browser.

    Does it validate against a schema (XSD)?

    No. It checks that XML is well-formed, which catches syntax errors. Schema validation needs the XSD file and a dedicated validator.

    Are comments kept?

    Yes by default. Untick Keep comments to remove them.

    Is CDATA preserved?

    Yes. CDATA sections are written back unchanged.

    Can I minify XML?

    Yes. Choose Minify under Indent.

    Why do I get a parser error?

    Common causes are an unescaped &, a missing closing tag, mismatched case or two root elements.

    Can I format HTML with it?

    Only XHTML. Regular HTML is often not well-formed XML.