YAML to JSON
Paste a document and read the converted text beside it, with the values that usually change flagged rather than quietly rewritten. This page reads YAML 1.2 core, so debug: no comes out as the string "no" and not as false, released: 2026-09-21 comes out as the string "2026-09-21" and not as a timestamp, and an integer past 2^53 - 1 such as 9007199254740993 is kept as a string with a warning rather than rounded to 9007199254740992 the way a reader that parses into doubles would round it. Every warning carries the line and the column it came from, and the path of the value it is about, so a conversion with no warnings means something. Switch the direction and the same page prints JSON as YAML, quoting any string a reader could take for a number, a boolean or a date, including the famous Norwegian no. A tab used to indent, a key defined twice, an alias with no anchor and an anchor chain that multiplies are each refused by name with a position instead of being guessed at, and both directions run in this browser with nothing uploaded.
{
"name": "gizmobench",
"released": "2026-09-21",
"debug": "no",
"port": 8080,
"id": "9007199254740993",
"tags": [
"config",
"yaml"
]
}- 5:5big-intid at 5:5 is 9007199254740993, past 2^53 - 1, and a reader that loads it as a double gets 9007199254740992 instead. It is written as the string "9007199254740993" here so that no digit is lost.
Converted to JSON: 11 lines, 6 keys, 1 warning. First at 5:5: id at 5:5 is 9007199254740993, past 2^53 - 1, and a reader that loads it as a double gets 9007199254740992 instead. It is written as the string "9007199254740993" here so that no digit is lost.
Read as YAML 1.2 core and printed as JSON, 2 spaces per level. yes, no, on and off are strings here; only true and false are booleans. 1 note about the conversion is listed beside the result.
- {"debug": "no"}
- {"released": "2026-09-21"}
- {"id": "9007199254740993"}, 1 warning
Up to 500,000 characters in one pass, converted here in your browser with nothing uploaded and no account. Nothing in the document is ever run or fetched: a tag is a string to the reader, a URL is a string, and alias expansion stops after 10,000 copied nodes. Nesting is read 100 levels deep. The direction, the indent and the draft are kept in this browser alone, drafts up to 100,000 characters, and the Start over control above the tool forgets them.
Common questions
- Why does debug: no convert to the string "no" instead of false?
- Because that is what YAML 1.2 says, and it is the single most common surprise in a config file. The 1.2 core schema resolves only true, True, TRUE, false, False and FALSE as booleans; yes, no, on, off, y and n are ordinary strings. YAML 1.1 read them as booleans, which is why the same file can mean two different things to two different tools, and why a Norwegian country code written as no is famous for it. Here debug: no converts to {"debug": "no"}. If you want a boolean in the JSON, write true or false in the YAML, or tag the value !!bool no and it converts to false.
- What happens to a long ID like 9007199254740993?
- It is kept as a string and warned about, rather than rounded. JSON numbers are read as doubles by nearly every reader, so anything past 2^53 - 1 loses its last digits: 9007199254740993 comes back as 9007199254740992, which is a different database row. This page converts it to "9007199254740993" and says so beside the result, with the line, the column and the path, so you can decide whether the value should be quoted in the source too. Going the other way, from JSON to YAML, the digits are written through unchanged, because YAML holds an integer of any size.
- Does a date-shaped value stay a string?
- Yes. YAML 1.2 core has no timestamp type, so released: 2026-09-21 converts to the string "2026-09-21" and a time such as 12:30:00 stays text rather than being read as base 60. That matches what JSON can hold, since JSON has no date type either. Converting the other way, a JSON string that looks like a date is quoted on the way into YAML, so a 1.1 reader downstream cannot turn it back into a timestamp.
- Can it convert JSON to YAML as well?
- Yes. Switch the Direction control beside the result to JSON to YAML and the same page prints block YAML at two or four spaces, and quotes any string a reader could take for something else: no, yes, on, off, true, 123, 2026-09-21, an empty string, one with leading or trailing spaces, one containing a colon and a space, and a multiline string, which is written with escapes so it reads back exactly. Round trip a document through both directions and the values come back identical, with the one exception this page warns about: an integer past 2^53 - 1 becomes a string on the way into JSON.
- What does it do with anchors, aliases and a YAML bomb?
- An anchor defined with &name is expanded wherever *name appears, because JSON has no anchors. The expansion is counted against a budget of 10,000 copied nodes: past that the converter stops, names the line and column of the alias that broke it, and converts nothing. That is what the billion laughs document does, a chain of anchors where each one repeats the one above it nine times. An alias inside the anchor it names is a cycle, and it is refused by name rather than expanded, because JSON holds a tree. An alias with no anchor above it is refused too. Merge keys are different: << is a YAML 1.1 extension, so it is converted as an ordinary key and a note says so.
- Why would it refuse to convert my file?
- Because a converter that guesses produces JSON you cannot trust. A tab used to indent is refused with its line and column, since YAML never allows one and the nesting is not knowable while it is there. A key defined twice is refused with both lines, because JSON cannot hold both and a reader that takes the last one quietly is how a config ends up doing something other than what it looks like. An unclosed quote or bracket, a second colon in a plain value and a tag outside the core schema are each named where they are. In the JSON to YAML direction the everyday mistakes get their own message too: a trailing comma, a comment, single quotes, an unquoted key, a leading zero, Python True or None, and JavaScript NaN, Infinity or undefined.
- Is my document uploaded anywhere?
- No. Both readers were written for this page and run in your browser, so nothing is uploaded, nothing is fetched and there is no account or size gate. A URL in the document is a string to the reader, and a tag outside the YAML 1.2 core set is refused by name rather than resolved, so a file carrying something like !!python/object/apply cannot do anything here. It converts up to 500,000 characters in one pass and 100 levels of nesting, and refuses anything longer with both numbers rather than cutting it down to fit. The direction, the indent and your draft are kept in this browser alone, and the Start over control above the tool forgets them.
Converted by a YAML 1.2 core-schema reader written for this page, so yes and no stay strings and a date-shaped value stays text rather than becoming a timestamp. An integer JSON cannot hold exactly is preserved as a string and warned about rather than silently rounded, alias cycles and alias chains past a fixed budget are refused, and both directions run in this browser with nothing uploaded.