YAML ⇄ JSON

Convert either direction, with validation as you type.

About & FAQ ↓
Input
Waiting for input.
Output

YAML parsing uses js-yaml's safe schema — no arbitrary tag execution.

Reference
YAML ⇄ JSON

About the YAML ⇄ JSON converter

Kubernetes manifests, CI pipelines, OpenAPI specs and application configs are YAML; APIs and tooling speak JSON. This converts either way as you type, detecting the direction from what you paste — JSON is valid YAML, so it tries JSON first. Multi-document YAML separated by --- round-trips to a JSON array.

01

Either direction, live

Converts as you type, detecting which way round you pasted.

02

Multi-document YAML

Kubernetes manifests separated by --- become a JSON array, and back again.

03

Errors by line and column

YAML parse failures point at the exact spot rather than failing silently.

04

Safe parsing

js-yaml's safe schema only — no tag can construct arbitrary types or run code.

How to use it

  1. Paste YAML or JSON, or drop a .yaml, .yml or .json file.
  2. The direction is detected automatically, or pin it with the Direction control.
  3. Adjust indentation and key sorting, then copy or download the result.

Questions

Can it convert a Kubernetes manifest?

Yes, including multi-document files: each document separated by --- becomes an element of the resulting JSON array.

Is YAML parsing safe?

It uses js-yaml's safe schema, which does not construct arbitrary types from tags. Nothing in your document can execute code.

Why did my tabs break the YAML?

YAML forbids tab characters for indentation. The tab option applies to JSON output only; YAML output falls back to two spaces.