Data Format Converter
Convert between JSON, XML and YAML online
Input
Output
Conversion Conventions
| Convention | Example |
|---|---|
| XML attributes become keys prefixed with @ | <user id="1">Tom</user> → {"user": {"@id": "1", "#text": "Tom"}} |
| Repeated sibling elements collapse into an array | <item>a</item><item>b</item> → {"item": ["a", "b"]} |
| Text-only elements become strings; text alongside attributes/children goes to the #text key | <name>Tom</name> → {"name": "Tom"} |
| JSON to XML: multiple top-level keys are wrapped in <root>, top-level array items are named item; illegal XML name characters become _ | [1, 2] → <root><item>1</item><item>2</item></root> |
XML is untyped: numbers and booleans are treated as strings. The XML declaration, DOCTYPE and comments are ignored during conversion. JSON and YAML output uses 2-space indentation.
Supported YAML Subset
Supported:
- Block mappings (key: value, arbitrarily nested)
- Block sequences (items starting with -, including nested maps and lists)
- Scalars: strings, integers/floats, true/false, null (and ~)
- Single/double-quoted strings, inline and full-line # comments; only the first document of multi-document input is parsed
Not supported (reported with a line number):
- Anchors &, aliases * and tags !
- Flow syntax {a: 1} and [1, 2] (except empty [] / {})
- Block scalars | and > (literal/folded multiline text)
- Complex keys ? and tab indentation
Use Cases
Quickly convert between the three formats when debugging APIs, migrating configuration files or cleaning data: turn XML API payloads into readable JSON, convert YAML configs (CI/CD, Docker Compose snippets) to JSON for programmatic processing, or generate them back. All conversion runs locally in your browser — your data is never uploaded.
How to Use
Pick the source and target formats (use ⇄ to swap), paste your data and click "Convert". Parse failures are reported with a line-number hint. The result appears in the output panel and can be copied with one click. Converting a format to itself works as a formatter and validator.