How do I format XML online?
Paste your XML and it is reformatted instantly: nested elements are indented by depth, each opening and closing tag gets its own line, and elements that contain only text stay on one line so values remain easy to read. The built-in example is a one-line bookstore document; formatted, it becomes 12 lines with the two book elements indented inside the root and each title, author and price on its own line. Choose 2 spaces, 4 spaces or a tab for indentation to match your project style. Formatting only changes whitespace between tags: element names, attributes, text, comments and CDATA sections are preserved character for character, and attribute values containing special characters are never split.
How do I validate XML?
Press Validate and the browser's XML parser checks the document for well-formedness: every opening tag must have a matching closing tag, tags must nest correctly, attributes must be quoted, and there must be exactly one root element. Valid documents report the root element name, for example the bookstore example validates with root element bookstore. Invalid documents show the parser's error message, which usually points at the first problem, such as a mismatched closing tag or an unquoted attribute. Validation is about syntax, not meaning: a document can be well-formed XML yet still fail a schema (XSD) check for wrong element names or data types, which this tool does not test.
When should I minify XML instead?
Minify mode removes the whitespace between tags, squeezing the document back to a single line while keeping text content intact. The formatted 12-line example minifies to one line with no spaces between elements. Minified XML is smaller to store and faster to transfer, which matters for large feeds, sitemaps, configuration files and API payloads where nobody reads the raw text. Keep the formatted version in your editor and repositories for humans, and minify the copy that ships to machines. Minifying is fully reversible: formatting a minified document restores the same structure, because only inter-tag whitespace is ever removed.
What does the formatter preserve?
Everything except inter-tag whitespace. Comments stay comments, CDATA sections keep their literal content (including characters like angle brackets inside them), processing instructions such as the XML declaration stay at the top, and self-closing tags stay self-closing. Attribute order and values are untouched, entity references are left as written, and text nodes keep their content, trimmed only of surrounding layout whitespace. The stats panel counts elements (opening and self-closing tags) so you can sanity-check a document at a glance: the bookstore example has 9 elements. The sample button loads an RSS feed containing a declaration, a comment and a CDATA description, so you can see each construct handled.
Where is XML still used?
Everywhere in infrastructure: RSS and Atom feeds, XML sitemaps for search engines, SVG images, Office document internals (docx and xlsx are zipped XML), Android layouts and manifests, Maven and Ant build files, Spring and .NET configuration, SOAP web services, plist files on Apple platforms, and data exchange in finance, healthcare and publishing. Developers meet XML in API responses, config files and error logs daily, usually as an unreadable single line from a log file or a minified payload. A formatter turns that wall of text into a structure you can scan, diff and debug in seconds.
Is it free and private?
Yes. The XML formatter is free, with no signup, no account and no limits. Formatting, minifying and validation all run in your browser, so your documents, which may contain config values, feed data or internal API payloads, are never sent to a server, stored or logged. For developers, QA engineers and anyone debugging an XML feed or config, this page does the job in seconds.