HCODX/XML Validator
100% browser-based · Native DOMParser · No upload

XML Validator

Validate XML for well-formedness. Detects unclosed tags, mismatched elements, invalid attributes, and structural issues. Uses your browser's native DOMParser — no upload, no extra libraries.

XML input
Validation result
Options
Open in formatter
Input size
0 B
Lines
0
Errors
0
Status
Ready
Example

Valid vs invalid XML

Every open tag needs a matching close. Attributes must be quoted. Reserved characters must be escaped. The validator reports the first failure.

Valid
<root>
  <item id="1">one</item>
  <item id="2">two</item>
</root>
Invalid — unclosed tag
<root>
  <item id="1">one</item>
  <item id="2">two
</root>
Use cases

What you'll use this for

SOAP, RSS, Atom feeds, configuration files, document interchange — anywhere XML is the wire format.

RSS / Atom feeds

Confirm a feed is well-formed before publishing or subscribing.

Config files

Validate pom.xml, web.config, build descriptors before commit.

SOAP envelopes

Catch broken envelopes before sending to a legacy service.

Sitemaps

Validate sitemap.xml before submitting to search engines.

Step by step

How to validate XML

1

Paste your XML

Drop it into the left editor. CodeMirror highlights tags, attributes, and entities.

2

Click Validate

Or leave auto-validate on for live feedback. DOMParser runs locally — no server.

3

Read the report

If well-formed you'll see a tick. If not you'll see the parsererror text from the browser plus a snippet around the failure.

4

Fix and re-run

Close that tag or quote that attribute, re-validate. Auto-validate keeps the report fresh while you type.

FAQ

Frequently asked questions

No — only well-formedness (does the XML parse). For schema validation against an XML Schema Definition, use a dedicated XSD validator.

Yes — the underlying DOMParser is namespace-aware. xmlns declarations and prefixed elements parse correctly.

Yes. No signup, no limits, no ads.

No. Parsing runs entirely with the browser's native DOMParser. Your data never leaves your device.

This tool checks well-formedness only (tags balanced, attributes quoted, characters escaped). It can't tell whether your XML satisfies a business rule — that requires schema or domain-specific validation.

About

About this validator

XML is verbose but strict: every open tag needs a close, every attribute needs quotes, every < or & in text needs escaping. This validator uses the browser's native DOMParser — the same engine SAX, XSLT, and most XML libraries call out to under the hood.

What it checks

  • Tag balance — every <tag> has a matching </tag> or is self-closing (<tag/>).
  • Attribute quoting — attribute values must be enclosed in single or double quotes.
  • Character escaping&, <, > in text must use entities.
  • Single root — well-formed XML has exactly one root element.
  • Namespacesxmlns declarations and prefixed elements are recognized.

What it doesn't do

  • XSD / DTD validation. Schema-aware validation is not part of well-formedness — use a dedicated XSD validator.
  • Semantic checks. A well-formed XML doc may still fail your business rules.
  • Pretty-print. Use the XML formatter for that.
Related

Related tools