How to use
- Choose YAML or XML and paste your document.
- Format, minify, or convert to JSON.
Worked example
A YAML file indented with a tab reports “tab characters must not be used in indentation” at the exact line.
Supported formats and limits
| Input | YAML, XML |
|---|---|
| Output | YAML, XML, JSON |
| Engine | js-yaml (YAML 1.2) and fast-xml-parser with validator |
Limitations
- XML is checked for well-formedness, not against a DTD or XSD.
- Minify is available for XML only. Converting to JSON drops comments, and several YAML documents become one JSON array.
Questions
How do I convert XML to JSON?
Paste the XML, which is checked for well-formedness first, then convert it to JSON. Attributes and text content become JSON keys, and the JSON can be converted back to XML.
How do I convert YAML to JSON?
Paste the YAML and convert it. It is first validated as YAML 1.2, so an error shows the line and column instead of producing broken JSON.
What does the validation check?
YAML is parsed as YAML 1.2 (core schema with << merge keys), so errors such as a tab in the indentation are reported at their line. XML is checked for well-formedness: one root element, closed tags, defined entities and valid attribute values. It does not validate against a DTD or XSD.
Are YAML comments kept when formatting?
Yes. Formatting uses Prettier's YAML printer, which keeps comments and key order. Converting to JSON cannot keep comments.
How are XML attributes shown in JSON?
Attributes become keys prefixed with @_ and element text is stored under #text, and the same convention is used to build XML from JSON.
Privacy
Runs on your device. Files and text are processed in this browser tab and are not uploaded.
See the privacy policy for how toolsdocks handles data.