JSON ↔ YAML ↔ XML

Runs in your browserConverters#Developer#Data

Convert data between JSON, YAML and XML in any direction, with clear errors and file open.

Output (YAML)
order:
  '@_id': INV-2026-041
  customer: Asha Traders
  city: Pune
  paid: true
  items:
    - name: Notebook
      qty: 12
      price: 45.5
    - name: Pen & refill
      qty: 30
      price: 10
How to use, limits & privacy

About JSON ↔ YAML ↔ XML

Convert data between JSON, YAML and XML as you type. The input format is detected for you, errors point to the line and column, and the output can be copied, downloaded or used as the next input with Swap. XML attributes and text are kept using the common @_name and #text keys. Everything runs in your browser, so configuration files and API data stay on your device.

How to Use

1

Paste or open your data

Paste JSON, YAML or XML into Input, click Open file, or drop a .json, .yaml or .xml file on the box. Click Example to see how it works.

2

Pick the output format

From is set to Auto, which detects the input; choose a format there if it guesses wrong. Choose JSON, YAML or XML under To. The output updates as you type.

3

Copy, download or swap

Use Copy or Download on the output, or Send to another tool. The arrow button makes the output the new input.

Privacy & Processing

  • Mode: local
  • Files Leave Browser: Local tool processing; review details below
  • Max Input Size: Device memory limits
  • Account Required: No
  • Data Stored Locally: Nothing is saved; the input is cleared when you leave the page.
  • Network Processing: Assets or models may require an initial download

Everything is converted in your browser. Your data and files are never uploaded.

Rules & Limitations

  • XML attributes become keys starting with @_ (id="7" becomes "@_id": 7), and text next to child elements becomes "#text". The order of mixed text and elements is not kept.
  • A single XML element becomes a value and repeated elements become a list, so a list with one item turns into a plain value after a round trip.
  • XML has no types: with the number switch on, 42 and true become numbers and booleans, while values like 007 stay text. Turn it off to keep everything as text.
  • Keys that are not valid XML names are changed (first name becomes first_name), and data with several top-level keys is wrapped in a <root> element.
  • YAML comments and anchors are not kept, and files over 10 MB cannot be opened.

Top Suggestions

  • Turning a Docker Compose or Kubernetes YAML file into JSON
  • Converting an XML API response or feed to JSON
  • Writing JSON settings as readable YAML
  • Producing XML for an older system from JSON data

JSON ↔ YAML ↔ XML FAQ

How do I convert YAML to JSON?

Paste the YAML into Input and choose JSON under To. If the YAML has several documents separated by ---, they become a JSON list.

How are XML attributes converted to JSON?

Each attribute becomes a key starting with @_, so <book id="7"> becomes { "book": { "@_id": 7 } }. Converting back to XML turns those keys into attributes again.

Why do I get an error with a line number?

The input is not valid in the detected format. The message names the line and column; common causes are a missing comma or quote in JSON, uneven indentation in YAML, or tags closed in the wrong order in XML.

What is the difference between JSON and YAML?

They hold the same kind of data. JSON uses braces and quotes and is common in APIs; YAML uses indentation, allows comments and is common in configuration files.

Is my data uploaded?

No. Parsing and conversion happen in your browser, so your files and API data never leave your device.