Skip to content

YAML to JSON

Convert YAML to JSON.

Loading…

About YAML to JSON

Compose files, CI workflows and application settings are written in YAML, but scripts and APIs often want JSON. Paste the YAML, press the button and the parsed document appears as indented JSON. Anchors and aliases are copied out in full, numbers, booleans and null are typed, and a syntax error tells you the line and column to fix. Only one document is read at a time.

Features

  • Parses YAML into two-space-indented JSON
  • Anchors and aliases are expanded into full copies
  • Numbers, booleans and null are typed; yes, no, on and off stay strings
  • Syntax errors name the line and column
  • Infinity and NaN are written as .inf and .nan strings instead of becoming null

Limitations

  • Only one document is accepted; a file with several documents separated by --- is rejected.
  • Merge keys are not applied: a << entry comes out as a key named <<, so inherited values are not merged in.
  • Duplicate mapping keys and tab indentation are errors, and explicit tags such as !!binary or !!timestamp are not supported.
  • A number like 1.0 becomes 1 in the JSON; quote it in the YAML if it must stay text.

How it works

  1. Paste your YAML into the YAML Input panel.
  2. Select Convert to JSON.
  3. Read the indented result in the JSON Output panel.
  4. If the middle column shows an error, fix the line and column it names and convert again.
  5. Use Copy Output to copy the JSON, or Clear All to start over.

Example input

name: Auro
tags:
  - json
  - yaml
active: true

Frequently asked questions