Calculates on this device. File exports run online.
XML Editor & Validator
Paste XML or open a file. The page checks that it is well-formed and shows where a mistake is, compares two documents, turns XML into JSON, and writes an XML Schema from your document or a sample from a schema. The server validates against an XSD or DTD.
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Run.
Your result
How it was worked out
How to use it
Choose what you want to do under What do you want to do?.
Paste your XML, or choose Or open an XML file from your device. The result appears as you type.
To check a document against a schema, use Validate against an XSD or DTD in the box below and choose your .xsd or .dtd file there.
After Make an XML Schema or Make sample XML, press Validate on the server with no file: the page result is checked against its schema.
What each part does
Check and format XML applies the rules of XML 1.0 and of namespaces and shows the line and column of the first mistake. It counts elements and attributes and formats the text.
Compare two XML documents lists elements, attributes and text that were added, removed or changed, by a path such as /order/item[2]/@qty.
Convert XML to JSON writes attributes as @name, text beside elements as #text and repeated elements as lists.
Make an XML Schema (XSD) from XML finds optional and repeating elements, required attributes and types (boolean, integer, decimal, date, dateTime, string) in your example.
Make sample XML from an XML Schema writes every element once with an example value, the first allowed value of a list, or the fixed or default value.
Validation on the server
The server checks XML against XML Schema 1.0 or 1.1 (with the xmlschema library) or against a DTD, and lists every problem with its line. Schemas that import other schemas need those files too: nothing is fetched from the internet, and entities are not loaded.
The server can convert large XML files to JSON, CSV, Excel or YAML, run XPath queries and compare two large documents. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.
Good to know
Well-formed and valid are different. Well-formed means the text follows the writing rules of XML. Valid means it also follows a schema.
A schema made from one example allows only what the example shows. Read it and widen it where your documents differ.
To make classes for a programming language, turn the XML into JSON here and give that JSON to the Data Model Code Generator.