XML Formatter & Validator
Format, validate, and minify XML instantly in your browser. Syntax error detection with line numbers, adjustable indentation, element and attribute stats — 100% private, no upload.
XML Formatter & Validator is a free browser-based tool that pretty-prints, minifies, and validates XML documents. Invalid XML shows a precise error message with line and column information. Adjustable 2/4-space or tab indentation, optional self-closing of empty elements, and live element/attribute/depth statistics. Everything runs locally with no upload and no account. Built by FreeToolHub.
Options
Result
Paste XML above and click "Format" or "Minify" to see the result here.
Common uses
Config files
Clean up and validate Maven POMs, Spring configs, Android manifests, and other XML-based configuration files before committing them.
API & SOAP debugging
Pretty-print a raw SOAP response or XML API payload to actually read it, and catch malformed XML before it breaks a client.
Feeds & sitemaps
Validate and format RSS, Atom, or sitemap.xml files so they parse correctly in feed readers and search engines.
Data migration
Minify large exported XML files to reduce size before transfer, or format them to review the structure during an ETL job.
Frequently Asked Questions
Is my XML uploaded anywhere?
No. Everything happens in your browser using JavaScript. Your XML is never sent to any server, so private configuration files, SOAP payloads, or feeds stay private.
How do I fix an XML validation error?
Click Format or Minify and, if the XML is invalid, the error message shows the line and column where the parser stopped along with the reason, such as a mismatched tag or an unclosed element. Fix that spot and try again.
What is the difference between Format and Minify?
Format pretty-prints your XML with indentation so nested elements are easy to read. Minify strips all whitespace between tags to produce the smallest possible output, useful for storage or transmission.
What does 'Self-close empty elements' do?
When enabled, an empty element written as <tag></tag> is rewritten as the shorter <tag/> form. Both forms are equivalent in valid XML; this is purely a style preference.
Does this tool support comments, CDATA, and processing instructions?
Yes. Comments, CDATA sections, and processing instructions such as the XML declaration are recognized and preserved as-is during formatting and minifying.
Is there a size limit?
No fixed limit. Formatting happens entirely in your browser, so performance depends on your device. Most documents up to several megabytes format instantly.