XML Tools
XML Parser Online
Run a real XML parse in your browser — see the structure parsers produce, or exactly where they fail.
In short
Parse XML online: check well-formedness with exact error positions, inspect the parsed structure as a tree, and see how parsers interpret your markup.
By NaveenKumar T · Updated
- True parser semantics
- Exact error line & column
- Parsed structure as a tree
Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →
Example
XML Parser: input and output
A shipment-tracking fragment with two tracking events — a good example of the repeated-element pattern XML parsers turn into arrays.
<?xml version="1.0" encoding="UTF-8"?><shipment><tracking_id>1Z999AA10123456784</tracking_id><carrier>UPS</carrier><status>In transit</status><events><event><city>Chicago, IL</city><time>2026-08-13T22:14:00Z</time></event><event><city>Louisville, KY</city><time>2026-08-14T02:47:00Z</time></event></events></shipment><?xml version="1.0" encoding="UTF-8"?>
<shipment>
<tracking_id>1Z999AA10123456784</tracking_id>
<carrier>UPS</carrier>
<status>In transit</status>
<events>
<event>
<city>Chicago, IL</city>
<time>2026-08-13T22:14:00Z</time>
</event>
<event>
<city>Louisville, KY</city>
<time>2026-08-14T02:47:00Z</time>
</event>
</events>
</shipment>The two <event> elements under <events> are exactly what a consuming parser turns into a list — the Tree view built from the same parse shows a 2-item events array instead of two separately named siblings.
Learn more
Parsing XML, explained
Parsing turns markup into structure: elements become nodes, attributes attach as properties, text becomes values, and strict rules — matched tags, single root, legal characters — are enforced along the way. One violation anywhere stops the parse, which is why error positions matter more in XML than almost any other format.
This page exposes the parse visually: the input editor marks failures at their exact position, and the tree shows the hierarchy that emerged — including details that surprise newcomers, like whitespace-only text nodes disappearing and repeated elements grouping into lists.
Common XML parse errors decoded
'Expected closing tag' means nesting broke somewhere above the reported line — check the most recently opened element. 'Invalid character' inside text is almost always a bare & (write &). 'XML declaration allowed only at the start of the document' means stray whitespace or a blank line precedes <?xml?>. Paste, read the position, fix — rarely more than a minute. Record-style XML that parsed cleanly is one click from a spreadsheet via XML to CSV or from an API via XML to JSON; the XML validator gives the same error positions without the tree.
Help
Frequently asked questions
Everything you need to know about the XML Parser.
01How do I use the XML Parser?
Paste your XML and press Parse. Well-formed markup renders formatted with a green badge; the Tree view shows the exact element/attribute structure a consuming parser would produce.
02How does the parser treat repeated elements and attributes?
Exactly as application parsers do: repeated sibling elements (multiple <item> tags) become a list — visible as an item count in the tree — while attributes attach to their element as @-prefixed entries, distinct from child elements of the same name.
03Does the tree preserve leading and trailing spaces inside element text?
This parser trims every text value, both the whitespace between elements and the whitespace inside an element's own text, so <name> Grace </name> shows as "Grace" rather than " Grace " with its surrounding spaces intact. That differs from XML's own rule, where whitespace inside text content is significant, and a consumer that preserves it would treat those spaces as real data. A whitespace-only element such as <note> </note> still parses to its own branch — as an empty string — rather than disappearing outright.
Keep working
Related tools
XML Validator
XML Tools
XML Viewer
XML Tools
XML to JSON
Parse any XML document into clean JSON — repeated elements become arrays, attributes preserved, text nodes kept.
XML Escape
The five XML entities, handled both directions — make any text safe inside elements and attributes.
XML to CSV
Turn record-style XML into spreadsheet-ready rows — wrapper elements unwrapped, nested fields flattened to columns.
JSON Parser
Run a real JSON parse in your browser — see exactly what your application will see, or exactly where it will fail.