🔀 JSON to YAML Converter

Convert JSON to YAML or YAML to JSON. Handles nested objects, arrays, strings, numbers, booleans and null. Runs entirely in your browser.

What comes out of each direction

JSON to YAML emits block style with two-space indentation, list items indented under their key, and no document marker. The sample becomes:

name: SimpleMoney Tools
free: true
categories:
  - Text
  - Dev
  - Finance
version: 2
owner: null

A string is only quoted when it needs to be: when it is empty, has leading or trailing spaces, reads as a number or as true, false or null, or contains one of the characters that mean something in YAML - : # [ ] { } " ' , & * ! | > % @ and the backtick. Everything else is written bare.

The subset the YAML side reads

Both conversions run in your browser with no upload, so a config file with real values stays on your machine. Round-trip anything important and compare before you rely on it.

Frequently asked questions

Why does my YAML value yes turn into true?

YAML 1.1 parsers, including Ruby's and older PyYAML, read yes, no, on and off as booleans - the same rule that turns the country code NO into false. This converter leaves those words unquoted, so quote them yourself if the value must stay a string.

Is every JSON file also valid YAML?

Under YAML 1.2, yes - JSON is a subset, so a real YAML parser accepts it. The parser on this page is not a full one, though: it reads the block style it produces, so paste JSON into the JSON to YAML direction rather than the other one.

Can I keep the comments when converting YAML to JSON?

No, and no tool can - JSON has no comment syntax, so full-line comments are dropped on the way in and nothing recreates them on the way back. Keep the YAML file as the source of truth if the comments matter.