{Y
Runs in your browserNothing is uploadedData, CSV & JSON

YAML to JSON

Convert YAML to JSON: maps, lists, nesting, comments, quoted strings, block text and inline [lists] and {maps}. Problems are reported by line.

Loading tool…
Short answer

YAML to JSON converts YAML config files into JSON. It reads maps, lists, nesting, comments, quoted strings, block text with | and >, and inline [lists] and {maps}. Problems and unsupported features such as anchors are reported with their line number.

Which YAML does it read?

The common subset

Everything most config files use: key: value maps, - lists, indentation, comments, single and double quotes, block scalars and flow collections. Values follow the YAML 1.2 core rules.

Not supported

Anchors (&), aliases (*), merge keys (<<), tags (!!) and files holding several documents. These stop with a clear message naming the line, rather than producing wrong JSON.

Why use YAML to JSON?

  • Check what a config really says. See exactly which values are strings, numbers or booleans after YAML has read them.
  • Clear errors. Tabs in indentation, duplicate keys and unclosed quotes are reported with the line to fix.
  • Private. Configs with secrets are converted in your browser and never uploaded.

How to use YAML to JSON, step by step

YAML to JSON in PrintxPDF with a file loaded, options on the right and the run button below
YAML to JSON with a file loaded: the steps below follow this screen.
  1. Paste YAML into YAML to JSON. Try the example to see comments, lists and a block of text converted.
  2. Read the JSON. It updates as you type. Choose 2 spaces, 4 spaces or minified.
  3. Copy or download. Save it as data.json or paste it where you need it.

Frequently asked questions

Is yes converted to true?

No. Under YAML 1.2, which modern tools follow, only true and false (in any common capitalisation) are booleans. yes and no stay strings.

Why is my file rejected?

Usually because of tabs used for indentation, a key that appears twice, or an anchor or alias. The message gives the line.

Does it support multiple documents separated by ---?

One document per conversion. A leading --- is fine; a second one is reported so you can convert each part separately.

Looking for the long version? The guides cover each of these jobs in depth.