XML Formatter & Validator
Pretty-print, minify and validate XML. Shows the exact line and column of syntax errors.
Loading the tool…
Runs entirely in your browser. Your files and text are never uploaded to our server.
- Instant results
- 100% free
- No sign-up
- Private
XML Formatter checks that your XML is well-formed and re-indents it with 2 spaces, 4 spaces or tabs. You can also minify it to a single line, remove comments, and write empty elements as self-closing or open/close pairs. CDATA sections, processing instructions and the XML declaration are kept.
Errors show the line and column so you can fix them quickly. Paste XML or open a file such as .xml, .svg, .rss, .gpx or .plist. For JSON, use the JSON Formatter.
More about XML Formatter & ValidatorHow to use, good to know & FAQ
How to use XML Formatter
- Paste XML or open a file.
- Choose the indentation.
- Click Format, Minify or Validate only.
- Copy or download the result.
Good to know
- It checks well-formedness (correct nesting, quoting and escaping). It does not validate against a DTD or XSD schema.
- Whitespace-only text between elements is removed when formatting. Text inside elements is kept.
- Your XML never leaves your browser.
Frequently asked questions
What does “not well-formed” mean?
The XML breaks a basic rule, such as a missing closing tag, an unquoted attribute or an unescaped & character. The message shows where.
Can it format SVG files?
Yes. SVG is XML, so you can format or minify it here.
Is there a size limit?
No fixed limit. Files of several megabytes work on most devices.
When to use XML Formatter
Use it to read API responses, sitemaps, RSS feeds, config files and SVGs, or to find why an XML file won’t load.
