XML Parser

Format, validate, and query XML documents instantly. Powered by native browser APIs for maximum speed and privacy.

Format & Minify XPath Querying Validation

How to Use XML Parser

1

Paste Your XML

Copy and paste your XML content into the input field, or click Load Sample XML.

2

Format & Validate

Use Format to beautify, Minify to compress, or Validate to check for errors.

3

Query with XPath

Enter an XPath expression and click Run XPath to extract specific nodes.

What is XML?

XML (eXtensible Markup Language) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. It is widely used for configuration files, data exchange (SOAP, RSS, Atom), and document storage.

Key XML Features

Self-descriptive

XML uses custom tags to describe data structure, making it easy to understand the content and hierarchy at a glance.

Platform Independent

As plain text, XML works across all platforms, programming languages, and systems without compatibility issues.

Extensible

You can define your own tags and document structure using DTD or XML Schema to suit any data model.

Frequently Asked Questions

What is the difference between well-formed and valid XML?

Well-formed XML follows the basic syntax rules of XML (proper nesting, closing tags, single root element). Valid XML is well-formed AND conforms to a schema (DTD, XSD) that defines the allowed structure and data types.

Does this tool validate against an XSD schema?

No, this tool checks for well-formedness only (syntax correctness). Schema-based validation against DTD or XSD is not supported in the browser natively.

What XPath version is supported?

The browser's native document.evaluate() supports XPath 1.0. This covers most common queries including axes, predicates, and functions like contains(), text(), and @attribute.

What are XML namespaces and how do they read?

A namespace maps element names to a URI via xmlns attributes - for example an atom:feed element declaring xmlns:atom="http://www.w3.org/2005/Atom". The prefix is arbitrary; only the URI identifies the namespace, so two documents can use different prefixes for the same vocabulary. Namespaces are why XPath matching often needs local-name() tricks when prefixes differ.

How does XPath select nodes?

XPath 1.0 expressions walk the tree: /rss/channel/item selects by path, //item finds items anywhere in the document, item[@type='news'] filters on an attribute, and predicates like item[1] or item[last()] pick specific nodes. It is the query language behind XSLT, many test frameworks, and this tool's evaluator.

What is XXE and could it affect this tool?

XXE (XML External Entity) injection abuses a DTD entity pointing at a file path or URL, making a server-side parser fetch it - historically leaking /etc/passwd or internal services. Browser XML parsers do not resolve external entities, and this tool runs entirely in your browser with no server round-trip, so pasted XML cannot trigger file reads or SSRF.

What is the difference between DOM and SAX parsing?

DOM loads the whole document into a tree you can navigate randomly - intuitive but memory-hungry for huge files. SAX streams events (start tag, text, end tag) in a single pass with constant memory - fast but forward-only. Browser JavaScript exposes DOMParser (DOM-style); streaming XML in JavaScript needs a library or Web Streams.

How do I include < or & inside XML content?

Escape them as &lt; and &amp; in ordinary text - < and & are illegal raw in character data. For blocks of markup-heavy text, wrap it in a CDATA section, which needs no escaping until it hits the sequence ]]> at its end. Only < and & are strictly required in content; > must be escaped only when it forms that closing sequence.

Will the tool remember my input if I refresh or close the tab?

Yes. Whatever you paste or type is kept as a draft in your browser's local storage, and the page restores it — with the results already re-parsed — the next time you open the tool. Clearing the input erases the draft. The data never leaves your device: no account, no upload, no server-side copy. Keys and secrets you enter for verification are never saved.

Parse, validate, and convert structured data formats like JSON, XML, CSV, YAML, and more