Boneyard Tools

YAML to JSON Converter

Paste YAML to get formatted JSON instantly. Handles lists, nested maps, anchors and aliases. Your data stays in your browser.

How to convert YAML to JSON

  1. Paste or type your YAML into the editor.
  2. Pick the JSON indentation you want, 2 or 4 spaces.
  3. Copy the JSON or download it as a .json file.

Examples

Mapping with a list

name: Ada
age: 36
skills:
  - math
  - logic
{
  "name": "Ada",
  "age": 36,
  "skills": [
    "math",
    "logic"
  ]
}

Frequently asked questions

Is my YAML uploaded anywhere?

No. The conversion runs entirely in your browser, so your YAML never leaves your device.

What is the difference between YAML and JSON?

Both describe the same kind of data. YAML uses indentation and is easy for people to read and write, while JSON uses braces and brackets and is the format most APIs and code expect.

Why would I convert YAML to JSON?

Config files are often written in YAML, but tools, APIs and JavaScript usually need JSON. Converting lets you reuse the same data where JSON is required.

What happens to comments and anchors?

JSON has no comments, so YAML comments are dropped. Anchors and aliases are resolved into the real values, so the JSON contains the fully expanded data.

Does it support nested maps and lists?

Yes. Nested mappings and sequences convert to nested JSON objects and arrays, with scalars mapped to the matching JSON types.

Can I paste JSON instead of YAML?

Yes. JSON is valid YAML, so pasting JSON works too and gives you a re-formatted, pretty-printed result.

Learn more

Related tools