XML Formatter
Paste XML to pretty-print, minify, or validate it. Parse errors are reported inline so you can fix broken markup fast.
Mode
Indent
How to use: pretty-print and validate XML with MakeMyTxt
Paste any XML document to pretty-print or minify it. Malformed markup is reported with the exact line and column of the problem.
- 1
Open the XML Formatter
Go to makemytxt.com/xml-formatter — the page is static, opens instantly, and keeps working after the first load even if the network drops.
- 2
Paste your XML
Drop in an RSS feed, a SOAP payload, an Android layout, a Maven pom.xml, or anything else built from tags. Parsing happens in your browser with a small tokenizer — nothing is uploaded.
- 3
Choose pretty-print or minify
Pretty-print with two or four-space indentation puts each element on its own line for easy review. Minify strips all inter-tag whitespace so the payload is as compact as possible for storage or network transfer.
- 4
Copy, download, or fix errors
If a tag is unbalanced or a declaration is malformed, the line and column of the failure are shown so you can jump straight to the problem. Otherwise copy the output or download it as a .xml file.
Frequently asked questions
- Does the XML formatter send my data anywhere?
- No. Parsing, validation, and serialization all run in your browser with a small custom tokenizer. Your document never leaves your device, which matters for API responses, configuration files, and anything covered by an NDA.
- What counts as a parse error?
- Unclosed tags, mismatched close tags (<a></b>), unterminated comments (no "-->"), unclosed CDATA sections, and malformed processing instructions. Well-formed XML with unknown element names or missing schemas is still accepted — this tool validates syntax, not schemas.
- How does minify differ from just stripping whitespace?
- Minify drops whitespace that exists only between tags for readability, but preserves text content inside elements exactly as written. That means <name> Alice </name> stays with its spaces because the whitespace is part of the element value, not indentation.
- Does the tool support namespaces, comments, and CDATA?
- Yes. XML namespaces (xmlns:foo attributes), comments (<!-- … -->), CDATA sections (<![CDATA[ … ]]>), processing instructions (<?xml …?>), and DOCTYPE declarations are all preserved through format and minify. Empty elements collapse to the self-closing <tag/> form.