XML Input

Formatted Output

What Is an XML Viewer?

You've got some XML — an API response, a config file, a SOAP payload — and it's all on one line or weirdly indented. This tool reformats it instantly with proper indentation and XML syntax highlighting so tags, attributes, values, and comments pop with distinct colors. You can read it in seconds without straining your eyes.

The parsing is done by your browser's own DOMParser API, right here in the tab, so internal configs, auth tokens and production payloads never travel over the network.

How to Use This Tool

1

Paste or Upload XML

Put your XML in the left-hand editor, either pasted in or read from a .xml or .txt file through Upload. Sample drops in a realistic document if you just want to poke around.

2

View the Formatted Output

The right panel instantly shows your XML pretty-printed with consistent 2-space indentation and full syntax highlighting. If the XML is invalid, you'll see a clear error message.

3

Copy or Download

Copy puts the formatted XML on the clipboard and Download hands it back as an .xml file. Need it in another format? Try the XML to JSON converter.

XML Viewer Examples

Paste compact or messy XML on the left and the viewer formats it with proper indentation on the right — ready to read:

Example: User record with address and roles

XML Input (raw):

XML Input

Formatted Output:

Formatted Output

Frequently Asked Questions

Can I view confidential XML here?

Yes. The document is parsed by the DOMParser API built into your browser and laid out by this page's own script. No request carries it anywhere, which the Network tab will confirm, so API keys, internal configs and sensitive payloads are fine to load.

What XML versions and encodings are supported?

The viewer supports XML 1.0 and XML 1.1 documents. UTF-8 is the standard encoding; most other encodings declared in the XML prolog are also handled by the browser's parser.

What happens when I paste invalid XML?

If your XML has a syntax error — unclosed tag, mismatched attribute quotes, illegal characters — the output panel shows a clear error message from the parser. This is useful for debugging. For dedicated validation against a schema, see the XML Validator.

Can I use this to format minified XML?

Absolutely — that's the main use case. Paste a single-line minified XML string (like a SOAP response or a minified config) and the viewer reformats it with proper indentation immediately. See also the XML Formatter for additional formatting options.

How is the XML Viewer different from the XML Formatter?

The XML Viewer focuses on reading and inspecting XML with syntax highlighting — think of it as a colored display for your data. The XML Formatter provides more control over indentation settings and output formatting. Both run fully in-browser.

Does this support XML with namespaces?

Yes. XML namespaces (declared with xmlns attributes as described in the W3C Namespaces spec) are preserved exactly as-is in the formatted output.

Related Tools

Further reading: the W3C XML 1.0 specification, MDN XML introduction, and Wikipedia on XML.