TXT · Text & Data tools

YAML to JSON Converter

Input · YAML
Output · JSON
0 Bin0 Bout0lines in0keysEmptyYAML
Go to the full Data Format Converter

YAML to JSON

Convert YAML to JSON. Paste YAML on the left; the JSON output builds on the right as you type.

name: vayce
tools: 224
categories:
  - images
  - text-and-data
active: true

becomes

{
  "name": "vayce",
  "tools": 224,
  "categories": ["images", "text-and-data"],
  "active": true
}

YAML mappings become JSON objects and YAML sequences become JSON arrays. Unquoted scalars that look like a number or boolean, 224 and true here, convert to the matching JSON type rather than staying strings.

What doesn’t survive

JSON has no comments and no anchors, so two YAML features disappear on this side of the conversion. A # note next to a key is gone in the output. An anchored value referenced elsewhere with *alias gets written out as a full duplicate instead of a shared reference, since JSON has no way to express “the same object as above.”

Parse errors

YAML’s indentation rules are stricter than they look: mixing tabs and spaces, or indenting a nested key by an odd number of spaces relative to its parent, produces a parse error rather than a guess. The input pane’s error footer shows the line and column the parser gave up at, taken from the same location YAML’s own error messages report.

Formatting first

If your YAML has formatting issues you want to fix without converting it, the YAML formatter validates and pretty-prints YAML in place. Come back here once the source is clean and you actually need JSON, CSV, XML, or TOML out of it.

Frequently Asked Questions

They're dropped. JSON has no comment syntax, so anything after a # in the YAML source doesn't appear anywhere in the output.

An alias resolves to a full copy of its anchored value during parsing, so the JSON output has the same value written out twice instead of one shared reference. The warning strip flags it when the input contains an anchor.

The input pane reports the exact line and column YAML's parser stopped at. Mixed tabs and spaces, inconsistent indentation, and an unquoted string containing a colon are the most common causes.

No. A file with multiple --- separated documents parses only its first document; split multi-document YAML before converting the rest.

Plain scalars that YAML recognizes as a number, boolean, or null convert to the matching JSON type. A YAML timestamp converts to a JavaScript Date internally and is written out as an ISO 8601 string in the JSON.

Jump straight to a conversion

Full Data Format Converter tool

Explore Our Tools

Browse all tools