YAML to JSON Browser Converter
Convert YAML to JSON or JSON to YAML locally in your browser without uploading config files, secrets, or CI snippets.
Written by Anil Gautam · Updated
Why did 3.10 become 3.1 in the JSON?
Unquoted YAML values are typed by how they look. Whole numbers and decimals become JSON numbers, so 3.10 turns into 3.1 and 007 into 7. The words true, false, yes, no, on and off become booleans in any letter case, which turns the country code NO into false. An empty value, ~ or null becomes null. Integers larger than 9,007,199,254,740,991 stay strings, because JavaScript cannot store them exactly, and hex values such as 0x1F and dates such as 2026-10-07 also stay strings.
The three lines python-version: 3.10, country: NO and zip: 007 convert to {"python-version": 3.1, "country": false, "zip": 7}. Quote them as "3.10", "NO" and "007" and all three come through as strings. Quoting also protects you from parser differences, since parsers that follow YAML 1.2 read yes, no, on and off as ordinary strings.
Which YAML layouts does the converter miss?
The converter uses its own small parser, which reads indentation with spaces only. List items must sit deeper than their key, as in tools: followed by lines that start with two spaces and a dash. A list written at the same depth as its key comes out as null and ends the conversion, so later keys never reach the JSON. Any unexpected extra indentation also stops it without an error, so compare the top-level keys of the output with your input.
Block scalars written with | or > are skipped: the indented lines below them disappear and the key becomes an empty object. Write multi-line text as a double-quoted string with \n line breaks instead. Inline lists and maps work only when they are valid JSON, so [1, 2] becomes an array and [x, y] stays the string "[x, y]". A space followed by # starts a comment anywhere on a line, even inside quotes, which cuts "C# and F# #1" short. Documents separated by --- merge into one object, with later keys winning.
What does the JSON to YAML output look like?
The JSON must parse first. A trailing comma or a single-quoted string stops it, and the status box shows the parser's message. Output uses two-space indentation, and an object inside a list is written as a lone - line with its keys indented below, which is valid YAML even if it looks unusual. Strings that YAML could misread get double quotes, including "3.10", "NO", "007", "yes", empty strings and text containing a colon followed by a space or a line break. Keys stay bare when they start with a letter or underscore and contain only letters, digits, underscores and hyphens; others, such as "a.b", are quoted.
Numbers pass through JavaScript, so 12345678901234567890 comes out as 12345678901234567000 and 1.10 as 1.1. Keep long IDs and version numbers as strings in the JSON. The JSON Formatter can validate and inspect the data before you convert it.