Data

XML Inspector

Format and validate XML, or convert it to JSON locally in your browser.

XML is parsed locally in your browser. Your input is not uploaded.
Quick startThree steps to your result
  1. 1

    Add your inputPaste or type your content in the input area.

  2. 2

    Set any optionsUse the controls below if you want to customize the result.

  3. 3

    Get your resultYour result appears below or updates as you work. Copy or download it when available.

Paste XML or choose a local file. Files are decoded as UTF-8; browser decoding may replace invalid byte sequences. Content is processed in this browser and is never uploaded.

Drop a file hereor choose a file from your deviceUp to 5.0 MB · .xml, text/xml, application/xml

Maximum input size: 5.0 MB. Size is checked before parsing; input is never truncated.

Formatted XML

Your result will appear here

Choose an action to process your XML. Results clear when the input changes.

XML to JSON mapping and limitations
  • Attributes are grouped under @attributes; element and attribute qualified names, including namespace prefixes, are retained.
  • Child names are object keys; repeated siblings become arrays, and a single child stays a single value.
  • Text-only elements become strings. Attributes and text use #text where needed; empty elements become an empty string.
  • Mixed text and child elements use ordered #content arrays. Comments and processing instructions are omitted from JSON. The XML declaration is document metadata, not an element.
  • Formatting preserves mixed text and CDATA without inserting layout whitespace there. Element-only indentation is added; serialization may normalize quote style, declarations, or empty-element notation.

Browser parser error details vary and may not include reliable line and column numbers. This tool never resolves external entities, loads URLs, executes scripts, or renders XML as HTML.

Quick answers

Frequently asked questions

What can the XML inspector do?

It can format and validate XML or convert supported XML input to JSON.

Why is my XML invalid?

Check that tags are properly nested and closed, attributes are quoted, and there is a single document root.

How is XML represented in JSON?

XML and JSON have different data models. The tool follows its displayed mapping rules, so review attributes, repeated elements, and text nodes in the output.

Does it load external entities or run scripts?

No. XML is parsed locally; the tool does not resolve external entities, fetch URLs, execute scripts, or render XML as HTML.