Data Format Converter

Convert between JSON, XML and YAML online

Input

Output

Conversion Conventions

ConventionExample
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:

Not supported (reported with a line number):

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.