Skip to content
Devtools 360

Convert YAML to JSON (and Back)

Paste Kubernetes manifests, CI pipelines or config files written in YAML and get equivalent JSON instantly. Flip the direction to turn JSON into clean YAML.

Runs in your browserFree · No sign-up

How to convert YAML to JSON

  1. Paste YAML, click Sample, or open a .yaml, .yml or .json file up to 10 MB.
  2. Choose the direction (YAML → JSON or JSON → YAML) and the indentation.
  3. Read the converted output; syntax errors show the line and column with an excerpt.
  4. Copy or download the result, or use "Swap input and output" to convert it back.

Supported formats

Input
YAML, JSON
Output
JSON, YAML
Maximum size
10 MB per file (limited by your device's memory)

Multi-document files and safe loading

A YAML stream can hold several documents separated by ---. When more than one is present, the converter outputs a JSON array with one element per document. Parsing uses the standard core schema only, so language-specific tags like !!js/function or !!python/object are rejected rather than executed. To pretty-print or check the resulting JSON further, use the JSON Formatter or the JSON Validator.

Benefits

  • Handles multi-document YAML streams that many converters silently truncate.
  • Safe by design: no custom tags or code execution.
  • Two-way conversion with a one-click swap.

Limitations

  • Comments are lost, and anchors and aliases are expanded, because JSON has no equivalent.
  • YAML merge keys (<<) are not supported, and dates stay as strings.
  • Integers beyond JavaScript's safe range (about 9 quadrillion) lose precision.

Privacy and security

Conversion uses the js-yaml library inside this tab. Files are read locally and never uploaded.

Read our privacy policy for details about the site as a whole.

Frequently asked questions

Why does "yes" stay a string instead of becoming true?

The converter follows YAML 1.2, where only true and false are booleans. YAML 1.1 parsers treated yes, no, on and off as booleans, which caused many surprises (the so-called Norway problem).

Is YAML a superset of JSON?

YAML 1.2 is designed so that valid JSON is also valid YAML, which is why you can paste JSON into the YAML side and it will parse.

Why is my indentation error reported on a different line?

YAML structure depends on indentation, so the parser often notices a mistake only on the next line whose indentation no longer fits. Check the reported line and the one above it.