JSON formatter / validator

JSON to YAML converter

Generate readable YAML from a JSON document, ideal for Kubernetes manifests, CI configs, and Helm values.

local only

Format pair conversion

JSON to YAML conversion notes

Use this JSON to YAML converter when a generated JSON document (for example an OpenAPI spec, a Helm values file, or a Kubernetes resource) needs to be checked in as YAML for diff readability. The converter produces YAML 1.2 output: scalars stay as primitives, arrays become block sequences, and objects become block mappings with two-space indentation. Strings that need quoting (because they contain a colon, leading whitespace, or look like a YAML reserved word) are wrapped in double quotes so the resulting document round-trips back to the same JSON. The page is browser-only, which keeps internal manifests on your machine.

Source

{"version":2,"services":{"api":{"image":"ghcr.io/example/api:1.4","ports":["8080:8080"],"env":{"LOG_LEVEL":"info"}}}}

Result

version: 2
services:
  api:
    image: ghcr.io/example/api:1.4
    ports:
      - 8080:8080
    env:
      LOG_LEVEL: info
Output spec
YAML 1.2 block style, two-space indent
Quoting rule
Strings that match yes/no/true/false/null or contain a colon are quoted to preserve type
Common pitfall
Avoid tab indentation in source JSON-derived YAML; use spaces

Source: YAML 1.2.2 specification, accessed 2026-05-06

FAQ

Is the JSON to YAML conversion lossless?

It round-trips for the JSON data model: nulls, booleans, numbers, strings, arrays, and objects map to the equivalent YAML scalars and collections. Comments and stylistic choices are not present in JSON, so the converter cannot recreate them.

Why are some strings wrapped in quotes in the YAML output?

Strings that look like a YAML reserved word (yes, no, true, false, null), start with whitespace, contain a leading dash, or include a colon followed by a space are quoted so they parse back as strings rather than booleans, nulls, or mapping keys.

Can I use this for Helm values or Kubernetes manifests?

Yes. The output is plain YAML that Helm, kubectl, and kustomize can consume. Generate the JSON with your tooling, paste it here, and copy the YAML into your repo.