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.

Everything runs in your browser using the built-in DOMParser API. No data is sent to any server — safe for internal configs, auth tokens, and production payloads.

How to Use This Tool

1

Paste or Upload XML

Paste your XML into the left editor or click Upload to load a .xml or .txt file. Hit Sample to load a realistic example.

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

Use Copy to grab the formatted XML to your clipboard, or Download to save it as a .xml file. Need to convert it? 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

Is my XML data private?

Yes. Parsing and formatting happen entirely in your browser using the native DOMParser API. Nothing is sent to a server — you can verify this in your browser's Network tab. Safe for API keys, internal configs, and sensitive payloads.

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.