XML Formatter
Pretty-print XML with clean, nested indentation.
- 100% Free
- No Sign Up
- Works in Your Browser
XML formatter
Indent XML so it's readable
Indent
Everything runs in your browser. Nothing is uploaded.
More Developer Tools
View all tools- JSON formatterPretty-print and indent JSON
- JSON validatorCheck JSON and find syntax errors
- JSON minifierStrip whitespace from JSON
- SQL formatterFormat SQL queries for readability
- HTML formatterBeautify and indent HTML
- Base64 encode/decodeEncode and decode Base64 text
- JWT decoderDecode a JSON Web Token
- UUID generatorGenerate random v4 or time-ordered v7 UUIDs
- Timestamp converterConvert Unix epoch time to dates
Every everyday developer tool, right in your browser.
No installs. No uploads. No signup.
Browse all 36 tools- Developer tools
- 36
- Cheat sheets
- 10
- Bytes uploaded
- 0
How to use the XML formatter
Three steps, all in your browser.
- 1
Paste your input
Type or paste your code or data. Press Sample to try an example.
- 2
Pick the style
Choose indentation or options. The result updates as you type.
- 3
Copy the result
Copy the output in one click. Nothing is saved or sent anywhere.
XML Formatter: what to know
The XML formatter parses your document and writes it back out with each element on its own line, indented by depth. It's the quickest way to read a SOAP response, an RSS or Atom feed, a sitemap, an SVG file or a Maven pom.xml that arrived as one long line.
Malformed XML is reported instead of guessed at. XML is strict: every element must be closed or self-closing (<br/>), tags must nest without overlapping, attribute values must be quoted, there must be exactly one root element, and the characters & and < must be escaped as & and < in text.
Only the whitespace between elements is re-indented; text is never changed. Mixed content, where text and tags are interleaved as in XHTML or DocBook, CDATA sections, comments and elements with xml:space="preserve" are kept exactly as written, because whitespace there can be meaningful. Errors are found with fast-xml-parser's validator and reported with their line and column.
Popular uses
- Reading SOAP and legacy API responses
- Inspecting RSS, Atom and sitemap files
- Tidying Android layouts, pom.xml and other XML configs
- Finding the unclosed tag in a broken document
Tips for the best result
- An error about an 'unescaped &' usually comes from a URL with query parameters inside the XML; write it as &.
- A byte order mark or blank line before the <?xml ...?> declaration makes some parsers fail; the declaration must come first.
- To compare two XML files, format both here first and then use the diff checker.
Read how JustYourDev works and our privacy details. Code, data and files you use here are processed in your browser and are never sent to our server.