1. Home
  2. JSON
  3. JSON to YAML

JSON to YAML

Convert JSON to clean YAML for Kubernetes, Docker Compose, Ansible and CI configs.

Runs in your browser
Indent

YAML

Waiting for input.
Convert back to JSON

What is the JSON to YAML?

YAML is easier to read and edit than JSON, which is why Kubernetes manifests, Docker Compose files, GitHub Actions, Ansible playbooks and OpenAPI specs use it. This converter turns any JSON into tidy, block-style YAML in one step.

It quotes strings that could otherwise change meaning, such as yes, no, on, off, 0o17 or 2026-10-02, so the YAML reads back as exactly the same data in both YAML 1.1 readers (PyYAML, older Kubernetes tooling) and YAML 1.2 readers.

How to use it

  1. Paste JSON, upload a .json file, or click Example.
  2. Pick 2 or 4 spaces and whether to sort keys.
  3. The YAML appears as you type.
  4. Copy it or download a .yaml file.

Example

Input
{"service":"web","replicas":2,"ports":[80,443],"debug":"no"}
Output
service: web
replicas: 2
ports:
  - 80
  - 443
debug: "no"

Features

  • Safe quoting. Strings like yes, no, on, off, null, dates and octal-looking numbers are quoted so no tool misreads them.
  • Exact numbers. Large integers such as IDs are written exactly, never rounded.
  • Readable output. Block style with no line folding, ready to paste into config files.
  • Sort keys. Optional alphabetical keys at every level for stable diffs.
  • JSONC input. Optionally accepts JSON with comments and trailing commas.
  • Private. Conversion runs in your browser; configs and secrets are never uploaded.

Frequently asked questions

Why are some strings in quotes?

In YAML, an unquoted yes, no, on or off can be read as true or false, 2026-10-02 as a date, and 0o17 as the number 15. Quoting these keeps them as text in every YAML tool.

Is YAML a superset of JSON?

Mostly. YAML 1.2 accepts almost any JSON as-is, but block-style YAML like this output is much easier for people to read and edit.

Will comments be kept?

JSON has no comments, so there are none to keep. If you allow comments in the input, they are removed during conversion.

Can I convert YAML back to JSON?

Yes. Use YAML to JSON, or click “Convert back to JSON” under the output.

Is my data uploaded?

No. Everything happens in your browser.

Last updated · Free, no sign-up, runs in your browser.

Free for everyone, kept free by you.

No paywall, no sign-up and no watermarks. If a tool saved you time, you can chip in any amount by UPI to keep Nova Free Tools running.

Esc
↑↓ move↵ openEsc close