JSON ↔ YAML

JSON ↔ YAML Converter

Bidirectional conversion built for k8s, GitHub Actions, Docker Compose, helm. Live preview, idiomatic YAML output, all in your browser.

js-yaml is great but adds ~30 KB minified to every page load. Real-world config-file YAML uses a small slice of the spec — block mappings, block sequences, flow style, scalar types, multi-line literals. We hand-rolled exactly that subset (~5 KB), so cold load stays fast. If your YAML uses anchors, aliases, or custom tags, paste it into a CI pipeline that uses js-yaml instead.

Three rare-in-config-file features: (1) anchors and aliases (&name / *name) — used to deduplicate within a doc; (2) custom tags (!!str / !!float / !!omap) — used to override implicit type inference; (3) multi-doc files with --- separators. None of these appear in standard k8s, GitHub Actions, Docker Compose, helm, or ansible files. If you need them, reach for a full YAML parser.

Input JSON
Output YAML

Built for real-world DevOps YAML

k8s, GitHub Actions, Docker Compose, helm, ansible — and a few small touches that make it actually fun to use.

Bidirectional, live

Paste either format, get the other instantly. Output updates on every keystroke — no Convert button. Toggle direction with one click and the same tool runs in reverse.

YAML 1.2 subset for config files

Block + flow mappings, block + flow sequences, scalars (string, number, boolean, null), multi-line literal (|) and folded (>) block scalars. Covers 99% of k8s manifests, GitHub Actions, Docker Compose, GitLab CI, helm values, ansible playbooks.

Idiomatic YAML output

JSON → YAML emits the YAML you'd write by hand: plain-style keys (no quotes), strings only quoted when they'd collide with reserved words (true/false/null/yes/no) or numbers, multi-line strings rendered as | block scalars, configurable 2 or 4-space indent.

Round-trip safe

JSON → YAML → JSON yields a byte-identical document. Convert in either direction, the other direction always reverses cleanly. No silently lost types or coerced values.

Privacy by design

Your config never leaves your device. Hand-rolled parser + serializer run as JavaScript locally. Open DevTools → Network and verify zero outbound requests.

Tiny + fast

Pure JavaScript, no js-yaml dependency. Cold load is under 25 KB gzipped. A 100 KB k8s manifest converts in under 30 ms on a normal laptop.

How to convert JSON ↔ YAML

Three steps from raw config to the format you need.

  1. 1

    Paste your JSON or YAML

    Drop your config into the Input pane. The tool detects which format you've pasted from the Direction dropdown — flip it if needed. Conversion runs live on every keystroke.

  2. 2

    Tune indent and verify

    Default indent is 2 spaces (k8s / GitHub Actions convention). Switch to 4 if your team uses that. Click Swap to flip output back to input — useful for round-trip verification (paste JSON, convert to YAML, swap, convert back, compare with original).

  3. 3

    Copy or download

    Hit the copy icon to push the output to your clipboard, or the download icon to save as output.yaml or output.json. The byte-size diff is shown in the footer so you can see how compact the YAML representation is.

Built for DevOps + backend teams

Four common scenarios where a privacy-first browser tool beats writing a one-off Python script.

Kubernetes manifests round-trip

kubectl get deployment my-app -o json → paste here → YAML → edit → apply. Or: paste a YAML manifest from a vendor's docs, convert to JSON, run it through jq for filtering, convert back to YAML, commit.

GitHub Actions / GitLab CI snippets from blog posts

A blog post shows a CI snippet as JSON in their docs theme. Drop it in, get YAML, paste into .github/workflows/ci.yml. Or: take a multi-job YAML workflow, convert to JSON for programmatic editing, convert back.

Helm values + Docker Compose

Helm values files are YAML; some templating tools want JSON. Paste your values.yaml, get JSON, run through your tool, paste back, convert to YAML for commit. Same workflow for Docker Compose's compose.yaml.

Sensitive configs that can't go to a third-party service

Configs containing API keys, secrets, internal hostnames, customer data — anything you can't paste into a cloud converter. The browser-only tool keeps every byte on your laptop. Open DevTools → Network and verify nothing leaves.

100% private — runs in your browser

Your configs never leave your device. Open DevTools → Network and you'll see zero outbound requests during conversion.

  • Hand-rolled YAML parser, YAML serializer, native JSON.parse, and the clipboard / download all run as JavaScript on your machine — no js-yaml CDN, no third-party API.
  • No login, no telemetry on config content. We only use one cookie for cookie-consent state and one for language preference.
  • If you handle sensitive infra config (kubeconfig snippets, secret manifests, signed certs), the privacy story matters — paste with confidence. Verifiable in DevTools.

Related guides

Hand-picked reads on YAML config patterns, JSON tooling, and DevOps file formats.

Frequently asked

Why build YAML support if <code>js-yaml</code> exists?

js-yaml is great but adds ~30 KB minified to every page load. Real-world config-file YAML uses a small slice of the spec — block mappings, block sequences, flow style, scalar types, multi-line literals. We hand-rolled exactly that subset (~5 KB), so cold load stays fast. If your YAML uses anchors, aliases, or custom tags, paste it into a CI pipeline that uses js-yaml instead.

What YAML features are NOT supported?

Three rare-in-config-file features: (1) anchors and aliases (&name / *name) — used to deduplicate within a doc; (2) custom tags (!!str / !!float / !!omap) — used to override implicit type inference; (3) multi-doc files with --- separators. None of these appear in standard k8s, GitHub Actions, Docker Compose, helm, or ansible files. If you need them, reach for a full YAML parser.

Are comments preserved?

No — comments are stripped on parse. YAML supports comments (#...) but JSON does not. Round-tripping YAML through JSON loses comment information by definition. We strip comments on parse rather than try to preserve them with hacks. If you need comment-preserving YAML editing, edit the YAML directly.

Why is my number being converted to a string?

YAML's implicit type rules are looser than JSON's: 1.2.3 is a string in YAML (not a number, because it has two dots), and version strings like v1.2 are strings unless quoted. We follow YAML 1.2 implicit-type rules: only digits matching ^-?\d+(\.\d+)?([eE][-+]?\d+)?$ become numbers; anything else stays a string. If you need exact numeric handling, quote the value in YAML or use JSON directly.

Is anything sent to your server?

No. The YAML parser, serializer, JSON parser, and clipboard copy all run in JavaScript on your device. Open DevTools → Network and you'll see zero outbound requests during conversion. Paste production k8s manifests, internal CI configs, secret-laden helm values — nothing leaves your laptop.