YAML to JSON
Convert YAML into JSON in your browser. Handles nested maps, lists, anchors and multi-document files, with selectable indentation.
Paste YAML
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
- Paste your YAML into the input box.
- Pick the JSON indentation you want.
- 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
| Criterion | UrsaKit Converter | Writing a script | Online tools with ads |
|---|---|---|---|
| Setup | Open the page | Install a library | None, but ads |
| Anchors and multi-doc | Handled | Handled | Often not |
| Data leaves the device | No, runs in the browser | No | Depends on the site |
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.