How to use it
- Paste your JSON into JSON text.
- Choose the Indentation you want. Two spaces is the usual choice for YAML files.
- Read Validity. If it names a line and column, fix the JSON there first.
- Copy the YAML text, or download it as data.yaml.
How JSON becomes YAML
The YAML 1.2 specification sets out to make YAML a strict superset of JSON, so JSON text is valid YAML data. The conversion keeps the same data and changes only how it is written. An object becomes lines of the form name: value, an array becomes a list with a dash before each item, and nesting is shown by indentation instead of brackets.
- Strings, numbers, true, false and null keep their values. A string that YAML would read as another type, such as "true" or "123", is written in quotes so it stays a string.
- A date such as 2026-11-10 stays plain text, because YAML 1.2 does not read it as a date. yes and on also stay text, since YAML 1.2 reads only true and false as booleans.
Numbers, names and lines of text
Whole numbers keep every digit: 12345678901234567890 is written exactly as typed. A decimal number is written as the nearest JavaScript number, so 1.50 becomes 1.5 with the same value. A decimal with more than about 15 significant digits may change in its last digits.
The names keep the order they have in the JSON, including names such as 2024 that a JavaScript object would move to the front. A string with line breaks is written as a block, so each of its lines stays on its own line.
Worked example: the default JSON
The default JSON is one object with five names: name, free, tags, version and license. The list under tags becomes a YAML list, with a dash and two spaces before each item.
With two spaces of indentation the result is the eight lines in the table, and it reads back as the same data.
| Line | YAML written |
|---|---|
| 1 | name: FireToolLand |
| 2 | free: true |
| 3 | tags: |
| 4 | - json |
| 5 | - csv |
| 6 | - yaml |
| 7 | version: 2.1 |
| 8 | license: null |
Frequently asked questions
Is YAML the same as JSON?
Not quite, but the YAML 1.2 specification sets out to make YAML a strict superset of JSON, so the data survives the conversion. YAML uses indentation rather than brackets, which makes it easier to read by hand.
Why are some strings in quotes in the YAML?
A string that YAML would read as another type, such as "true", "123" or "null", is written in quotes so that it stays a string. Other strings are written plain, without quotes.
Are the numbers changed?
Whole numbers keep every digit, so 12345678901234567890 stays the same. A decimal is written as the nearest number, so 1.50 becomes 1.5 with the same value.
Why two or four spaces of indentation?
YAML shows nesting with spaces, not tabs. Two spaces make a shorter file and four spaces a wider one; both read back as the same data, so choose the style your project uses.
Why is a name that appears twice in one object refused?
A YAML mapping holds one value for each name, so the second value would be lost without any warning. The tool asks you to remove the repeated name instead of guessing which value to keep.
Is my JSON uploaded anywhere?
No. The conversion runs in your browser with the yaml library, and nothing you paste is sent to our server.
Sources
- YAML Ain't Markup Language (YAML) revision 1.2.2
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format
- yaml: the JavaScript YAML library used by this tool
Figures and text last checked on Tuesday, November 10, 2026.