InovoTools
Developer Tools

XML Formatter and Minifier

Make XML readable with clean indentation, or minify it to save space. The formatter also spots unclosed and mismatched tags, so you know where a broken file goes wrong.

01

Your inputs

Start with the example, or enter your own values.

Processed in your browser. Your inputs stay on this device.

02

Your result

A little clarity, coming right up.

Make room for the answer.

Enter your values and run the tool. Your result will appear here.

How to use the XML Formatter

Paste your XML, choose pretty print or minify and the indent size, then copy the result. Errors in tag nesting are reported instead of output.

Pretty print or minify

Pretty printing puts each element on its own line and indents children under their parents, which makes feeds, sitemaps and config files easy to read and compare. Minifying removes the whitespace between tags to make the file smaller for sending over a network. The data inside stays the same either way.

Well formed XML

Every opening tag needs a matching closing tag, tags must close in the reverse order they opened, and there must be a single root element. The formatter checks this nesting as it goes. It does not validate against a schema or DTD, so a file can be well formed and still be missing data an app expects.

How it works

Tokenizes tags and text, tracking a stack of open elements.

Examples

  • With the default values
    <?xml version="1.0"?>
    <catalog>
      <book id="1">
        <title>Dune</title>

Limitations and assumptions

Checks tag nesting only. It does not validate against a schema or DTD, or expand entities.

Frequently asked questions

Does it validate my XML?

It checks that tags are properly opened, closed and nested. It does not check against a schema.

Can I choose the indent size?

Yes. Pick the indent you prefer before formatting.

Is my XML uploaded?

No. Formatting happens in your browser.