YAML to JSON Converter

Paste YAML, get formatted JSON

Input (YAML)

Output (JSON)

YAML to JSON Converter guide

YAML is easy to write by hand, but most scripts, APIs, and tools like jq expect JSON. Paste a Kubernetes manifest, Compose file, or any YAML config and get formatted JSON back.

How it converts

  • Anchors and merge keys. References like <<: *defaults are expanded, so the JSON contains the full values.
  • Comments. Dropped, because JSON has no comments.
  • Multiple documents. Only one document is supported. If your file has several separated by ---, convert them one at a time.

Example

A config with a shared anchor:

base: &base
  replicas: 2
prod:
  <<: *base
  region: eu

// converts to

{
  "base": { "replicas": 2 },
  "prod": { "replicas": 2, "region": "eu" }
}

Frequently asked questions

Why do I get "expected a single document"?
Your YAML contains more than one document separated by ---. Paste one document at a time.
Does yes become true?
No. The converter follows YAML 1.2, where only true and false are booleans, so yes, no, on, and off stay strings.
Are my YAML comments kept?
No. JSON has no comment syntax, so comments are removed during conversion.