XML Formatter & Validator

Format, validate, and pretty-print XML instantly in your browser, catching unclosed or mismatched tags and other syntax errors. Also minifies XML for transmission and preserves the XML declaration, with nothing uploaded to a server.

Output

Recent conversions

No saved conversions yet.

Usage examples

Reading a minified XML response

Got an API response or config file squeezed onto one line? Paste it in and see it instantly indented so you can read the tag structure at a glance.

Finding an unclosed or mismatched tag

Not sure where your XML broke? Paste it in and the error message points to exactly where parsing failed.

Minifying XML before sending it

Need the smallest possible payload? Switch to the Minify tab to strip all line breaks and insignificant whitespace.

Comparing two versions of an XML config

Format both an old and a new version of a config file the same way first, so a side-by-side diff only highlights the actual content changes instead of whitespace differences.

Preparing XML for a code review

Paste a minified XML payload from a pull request's test fixture to format it before review, making the actual structural change easy to spot.

Frequently asked questions

Is the XML I paste sent to a server?

No. All parsing and formatting happens entirely in your browser and is never sent to a server.

What exactly does 'valid XML' check here?

This tool checks that your XML is well-formed: tags are properly opened and closed, nesting is correct, and attribute syntax is valid. It does not check validity against a schema such as a DTD or XSD.

Is the XML declaration preserved?

Yes. If your input starts with an XML declaration (the line that specifies version and encoding), it's kept as-is and reattached to the top of the output.

Where is what I typed saved?

Only in your browser's local storage (localStorage). Revisiting the page restores your input, output, and recent conversion history. It's not shared across devices or browsers, and you can clear your history at any time.

How many recent conversions are kept?

Up to 20. Older entries are automatically dropped once the limit is reached.

Does formatting change the meaning of the XML?

No. Formatting only adds or removes whitespace between tags — it never changes element names, attributes, text content, or the document's structure.

Can this handle XML namespaces?

Yes. Namespace prefixes and declarations (like xmlns:foo="...") are preserved exactly as written; the tool only reformats whitespace, it doesn't resolve or validate namespace URIs.