FormatPaste

XML Formatter

Paste XML, format it instantly, and copy clean indented output.

Ready
All formatters

Input

Don't paste secrets · formatting is not stored

Output

formatted

Free XML formatter

Format XML online for API responses and config snippets

Use this XML formatter for compact XML, API responses, copied configuration, generated markup, or nested tags that are hard to read on one line. Paste XML on the left and copy clean formatted XML from the right.

Pretty print XML

Turn compact or messy XML into readable nested markup with clean indentation.

Great for API responses

Format copied XML responses, config files, build files, and generated snippets.

Copy formatted XML

Paste XML, inspect the structure, and copy clean output without opening a full editor.

How this XML formatter helps

Before and after formatting

Paste compact, copied, or hard-to-read XML into the input pane. FormatPaste cleans common paste artifacts first, then formats the code into readable output that is easier to scan, debug, share, or copy into your editor.

Common XML formatting use cases

Use it for quick snippets from documentation, AI chat output, Stack Overflow answers, config examples, API responses, old files, minified blocks, and code that picked up line numbers or markdown fences while being copied.

Safe paste reminder

FormatPaste is built for speed, but you should avoid pasting passwords, API keys, tokens, private keys, recovery codes, customer data, or other secrets into any online formatter. Use local tools for sensitive code.

XML formatting example

Before
<?xml version="1.0"?><catalog><book id="bk101"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><price>44.95</price></book></catalog>
After
<?xml version="1.0" ?>
<catalog>
  <book id="bk101">
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <price>44.95</price>
  </book>
</catalog>

When to use a XML formatter

Read SOAP and API responses

XML returned by SOAP services and older APIs usually arrives on one line. Formatting indents each element so you can find the field you need and check the response structure.

Check that XML is well formed

The input is parsed before it is printed. An unclosed tag, a mismatched closing tag, or an unescaped ampersand returns an error, so the formatter doubles as a quick XML validator.

Tidy config and build files

Maven pom.xml, Android layouts, .NET config files, and XML sitemaps are easier to edit when every element is on its own indented line.

Format SVG markup

SVG files exported from design tools are often compressed. Formatting shows each group and path on its own line, which helps when you edit icons by hand.

XML Formatter FAQ

How do I format XML online?

Paste XML into the input pane and FormatPaste formats it automatically.

Can it format compact XML?

Yes. It can expand compact XML into readable indented output.

Does this XML formatter validate XML?

If the XML cannot be parsed, the formatter returns an error instead of silently changing the markup.

Is this XML formatter free?

Yes. It is free for quick XML formatting.

Does formatting change my XML data?

Element names, attributes, and text values are kept. Whitespace between elements is treated as insignificant and replaced with indentation, so avoid formatting XML where that whitespace has meaning.

Can it format SOAP, RSS, SVG, or sitemap XML?

Yes. Any well-formed XML document can be formatted, including SOAP envelopes, RSS and Atom feeds, SVG images, Android layouts, Maven pom.xml files, and XML sitemaps.

What indentation does the XML formatter use?

Nested elements are indented with two spaces, and elements with many attributes are wrapped onto separate lines.