Skip to content

YAML to JSON Converter

Convert YAML to JSON and JSON to YAML bidirectionally.

Input (YAML)

Drop file here or click to browse

Maximum 5 MB (.yaml,.yml,.json,.txt)

Output (JSON)

About the YAML to JSON Converter

Convert YAML to JSON and JSON back to YAML. YAML is what you write by hand — Docker Compose files, Kubernetes manifests, GitHub Actions workflows — while JSON is what tools and APIs consume, so translating between them is a daily task in any infrastructure work.

How to use it

  1. 1 Paste YAML to convert it to JSON, or paste JSON to get YAML.
  2. 2 The direction is detected automatically from the input.
  3. 3 Any syntax error is reported with its location.
  4. 4 Copy the converted output into your config file.

What it does

  • Bidirectional YAML and JSON conversion
  • Validation with clear error messages for both formats
  • Preserves nesting, arrays and multi-line strings
  • Handles anchors and multiple documents

Frequently asked questions

Is my config file uploaded?

No. Every calculation happens locally in your browser using JavaScript. Nothing you paste is uploaded, logged, or stored on a server, which makes the tool safe to use with production data, credentials, and customer records.

Why does my YAML fail to parse?

Nine times out of ten it is indentation. YAML forbids tab characters for indentation — only spaces — and every item at the same level must align exactly. The other frequent cause is an unquoted string containing a colon followed by a space, which YAML reads as a key-value separator.

Why did my value "no" turn into false?

This is the notorious Norway problem. YAML 1.1 treats yes, no, on, off, true, and false as booleans, so the country code NO becomes false. Quote any string that could be mistaken for a boolean, a number, or a date.

Is every JSON document also valid YAML?

Yes — YAML 1.2 is a strict superset of JSON, so any valid JSON parses as YAML. The reverse is not true: YAML comments, anchors, and multi-document files have no JSON equivalent.

Are comments preserved when converting?

No. JSON has no comment syntax, so comments are necessarily lost when converting YAML to JSON, and converting back will not restore them. Keep the commented YAML as your source of truth.