Skip to content

Tools/YAML / TOML/YAML to JSON

YAML to JSON

This page opens YAML → JSON. Comments in YAML are dropped because JSON has no comment syntax. Dates may become strings — JSON has no date type.

Same converter: all directions · JSON to YAML · TOML to JSON · JSON to TOML

Loading tool…

How to use YAML to JSON

  1. 1. Paste YAML. Indentation matters. Keep spaces, not tabs.
  2. 2. Leave source as YAML and target as JSON. Preselected on this URL.
  3. 3. Copy JSON. Validate it in the JSON formatter if you need stricter errors.

About this tool

Teams search “yaml to json” when a values.yaml must become an API body or a ConfigMap snippet. This is that pair on the YAML ↔ JSON ↔ TOML tool, with the dropdowns already set.

Comments and anchors

JSON cannot store YAML comments. Anchors and merge keys may flatten. If you need comments back, keep the YAML original in git and treat JSON as a build artifact.

JSON is not a YAML superset in reverse

Going YAML → JSON is the lossy direction. JSON → YAML can re-emit maps cleanly, but you will not recover comments you already discarded.

Code examples

Node

import { parse } from "yaml";
parse("name: Ada");

This is one direction of the shared converter. The editor is the same; the title and default direction match this search.

Frequently asked questions

Related tools

All tools