Formatting XSD schema files
An .xsd schema is XML like any other document, and machine-generated schemas — exported from a designer tool or a code-first framework — routinely arrive as a single unreadable line. Paste one here and it indents like anything else, with the xs:-prefixed structure (xs:element, xs:complexType, xs:sequence) laid out by nesting depth, which is exactly the shape you need to actually read a schema. The attribute-wrapping toggle earns its keep on schemas in particular, since xs:element declarations stack up name, type, minOccurs, and maxOccurs on every line. One boundary to be clear about: formatting a schema is not the same as validating a document against that schema — the latter needs schema-aware tooling and no honest browser page should claim otherwise.
SOAP envelopes and WSDL files
SOAP responses are the classic "wall of XML" — an Envelope, a Body, three namespace prefixes, and your actual data buried four levels deep, usually delivered minified. Formatting one here makes the nesting visible, and the tree view is often faster still: collapse the envelope plumbing and expand only the payload. WSDL service definitions get the same treatment; the element counts table gives a quick census of operation and message elements. Namespaces are preserved exactly as written — prefixes are not rewritten, expanded, or "normalized," because changing them changes what the document means to a namespace-aware consumer.
Common XML errors, decoded
| Error | What actually happened | Fix |
|---|---|---|
| Mismatched closing tag | Tags closed in the wrong order — <a><b></a></b>. XML requires strict nesting; HTML's forgiveness doesn't apply. | Close the inner element before the outer. The validator names both tags and the line. |
Unescaped & | A raw ampersand in text — common in URLs (?a=1&b=2) pasted into XML. & must start an entity. | Write &, or wrap the run in CDATA. The escape module above does it. |
| Unquoted attribute | <a href=x> — legal in HTML, never in XML. Attribute values require quotes. | Quote it: href="x". |
| Multiple root elements | Two top-level elements — often a log file of concatenated XML fragments. | Wrap the fragments in a single container element. |
| Duplicate attribute | The same attribute name twice on one element — usually a copy-paste artifact. | Remove one; the validator points at the element. |
Frequently asked questions
What's the difference between "well-formed" and "valid"?
Well-formed means the document obeys XML's syntax rules: proper nesting, quoted attributes, escaped special characters, one root. Every XML parser on earth requires it, and it's what this page checks. Valid means well-formed and conforming to a specific schema (XSD, DTD, RELAX NG) — right elements, right order, right types. Validation requires the schema and a schema processor; a document can be perfectly well-formed and wildly invalid against its schema, and vice versa is impossible.
Does the encoding declaration matter?
The <?xml version="1.0" encoding="…"?> declaration tells parsers how the bytes of the file are encoded. By the time text reaches this page it's already been decoded by your browser or editor, so the declaration is preserved as-is but can't be verified against the original bytes here. Practical advice: use UTF-8, declare UTF-8, and the declaration becomes a formality — mismatches between declared and actual encoding are a file-level problem to fix at the source.
How large a file can this handle?
Formatting and validation are tested smooth to around 5 MB of XML in a typical browser, and degrade gracefully rather than crash beyond that — the practical ceiling is your machine's memory and patience, since everything happens in the tab. The tree view caps itself at 3,000 nodes (with a note when it truncates) because a hundred-thousand-node DOM of <details> elements helps nobody. For files well beyond that, command-line tooling is the honest recommendation.
Is my XML uploaded anywhere?
No. The parser is JavaScript written into this page — no server call, no CDN library, and the page works offline once loaded. SOAP payloads and config files tend to contain internal hostnames and IDs; that's exactly why this runs where your data already is.