About the XML Validator playground

The XML Validator checks whether a document is well-formed XML and reports errors with line information so you can fix them quickly. It verifies the rules that make XML well-formed: a single root element, properly nested and closed tags, quoted attribute values, and correctly escaped special characters. XML (Extensible Markup Language) is a self-describing, tag-based format used for configuration, SOAP and RSS feeds, document formats, and data exchange across many systems.

Validation runs entirely in your browser using the native parser, so your XML is never uploaded or stored on a server. Paste a document to instantly learn whether it is well-formed or get a message pointing at the offending line, such as a mismatched closing tag or an unescaped ampersand. This is ideal for debugging hand-edited config, checking a feed, or confirming generated XML parses cleanly before another system consumes it.

HostedXML Validator runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

External resources

  • w3.org/XML— Official website

Valid XML

<note>
  <to>Bob</to>
  <from>Alice</from>
  <body>Hello!</body>
</note>

Invalid: mismatched tag

<note>
  <to>Bob</from>
</note>
<!-- Error: closing tag </from> does not match <to> -->

Invalid: unescaped ampersand

<item>Tom & Jerry</item>
<!-- Error: '&' must be escaped as &amp; -->

Invalid: multiple roots

<a>1</a>
<b>2</b>
<!-- Error: document must have exactly one root element -->

Valid: attributes and self-closing

<config version="1.0">
  <item id="1" enabled="true"/>
  <item id="2" enabled="false"/>
</config>
<!-- Valid: quoted attributes and empty self-closing elements -->

Invalid: unquoted attribute

<a href=page.html>link</a>
<!-- Error: attribute values must be quoted, e.g. href="page.html" -->

Valid: comment, CDATA, declaration

<?xml version="1.0" encoding="UTF-8"?>
<doc>
  <!-- a comment -->
  <code><![CDATA[ if (a < b && b > c) {} ]]></code>
</doc>
<!-- Valid: CDATA lets < and & appear literally -->

Valid: namespaces

<root xmlns:h="http://example.com/html">
  <h:table>
    <h:tr><h:td>cell</h:td></h:tr>
  </h:table>
</root>
<!-- Valid: 'h' prefix is bound by the xmlns:h declaration -->

Invalid: improper nesting

<b><i>text</b></i>
<!-- Error: tags must nest; close </i> before </b> -->

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

How it works

Paste an XML document into the validator

The native browser parser checks it for well-formedness

On failure it points at the offending line

Rules it checks

A single root element with properly nested, closed tags

Quoted attribute values

Correctly escaped special characters like ampersands

Privacy

Validation runs entirely in your browser using the native parser

Your XML is never uploaded or stored on a server

Good for

Debugging hand-edited config or RSS/SOAP feeds

Confirming generated XML parses cleanly before another system reads it

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It checks whether text is well-formed XML and reports errors with line information so you can fix nesting, closing-tag, and escaping problems.
No. Validation happens in your browser with the native parser. Nothing is sent to a server.
Yes, it is free with no account or installation needed.
Well-formed means the syntax rules are satisfied: one root, closed and nested tags, quoted attributes. Valid additionally means it conforms to a DTD or schema, which is a separate check.
A bare '&' starts an entity reference in XML, so literal ampersands must be written as &amp;. The same applies to '<' as &lt; inside text.
Input
Issues

No input to validate

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup