JSON to YAML

Paste JSON and get readable block-style YAML, with strings that YAML could misread quoted for you.

Tier 0 · browser · unlimited
104 characters
Output
service: web
image: nginx:1.27
replicas: 3
ports:
  - 80:80
env:
  DEBUG: "no"
  REGION: "NO"

JSON and YAML

YAML is the format of choice for configuration that people edit: Kubernetes manifests, Docker Compose, CI pipelines and OpenAPI specs. It expresses the same data as JSON with indentation instead of braces and fewer quotes. In fact YAML 1.2 is a superset of JSON, so converting JSON to YAML never loses information.

The trap is implicit typing. In YAML, yes, no, on, off were booleans in version 1.1, 007 can become a number and an empty value is null. This converter quotes such strings so they stay strings in any YAML reader, a frequent cause of surprises like Norway's country code NO turning into false.

Worked example

{"service":"web","replicas":3,"ports":["80:80"],"debug":"no"}

becomes

service: web
replicas: 3
ports:
  - 80:80
debug: "no"

debug keeps its quotes because unquoted no is a boolean for YAML 1.1 tools.

How this works

The page parses the JSON strictly (invalid input is reported with line and column), then writes YAML 1.2 using block style: one key per line, list items with -, nesting by indentation of 2 or 4 spaces. Strings that a YAML parser might read as a boolean, null or number are wrapped in double quotes. Key order is preserved and long strings are never folded across lines. Use YAML to JSON for the reverse. Everything runs in this tab.

Frequently asked

Is the conversion lossless?

Yes. YAML 1.2 can represent every JSON value, and the page quotes strings that could be misread.

Why are some values quoted?

Unquoted yes, no, on, off, null, 007 or 1e3 could be read as booleans, null or numbers by YAML tools. Quotes keep them as strings.

Can I use tabs for indentation?

No. YAML does not allow tabs for indentation; use 2 or 4 spaces.

Is my data uploaded?

No. The conversion runs in your browser.

Sources

Reviewed Oct 17, 2026 · test vectors fixtures/dev/json-to-yaml/