YAML to JSON

Convert YAML into JSON in your browser. Handles nested maps, lists, anchors and multi-document files, with selectable indentation.

YAML input

Paste YAML

JSON output

Result

What is YAML to JSON conversion?

YAML and JSON both describe the same nested data structures, but YAML is easier to read while JSON is what APIs and JavaScript consume. Converting maps a YAML document onto the equivalent JSON value.

This tool parses the YAML with js-yaml and re-emits it as JSON, so anchors, lists and nested objects all carry over.

How to convert YAML to JSON

  1. Paste your YAML into the input box.
  2. Pick the JSON indentation you want.
  3. Press Convert to JSON and copy or download the result.

YAML to JSON examples

A nested map

name: UrsaKit
features:
  - json
  - yaml
{"name":"UrsaKit","features":["json","yaml"]}

Numbers and booleans

port: 8080
debug: false
{"port": 8080, "debug": false}

Browser converter vs other ways

CriterionUrsaKit ConverterWriting a scriptOnline tools with ads
SetupOpen the pageInstall a libraryNone, but ads
Anchors and multi-docHandledHandledOften not
Data leaves the deviceNo, runs in the browserNoDepends on the site
FAQ

Frequently asked questions

Is the converter free?

Yes, with no account and no limit.

Does it support YAML anchors?

Yes. Anchors and aliases are resolved as js-yaml parses the document.

Can I convert multiple documents?

If the file contains several documents separated by ---, only the first is converted because JSON has no equivalent for multiple roots.

Why did my dates change?

YAML treats unquoted timestamps as dates. Quote them to keep the original text.

Is my data uploaded?

No. Parsing runs in JavaScript in your browser.

All Tools