Skip to content

JSON to YAML Converter

Paste JSON and get clean YAML that every parser reads the same way, with your comments and key order kept.

Free · No signupConverted in your browser

Try

Valid JSON · 13 keys · depth 3

YAML17 lines
name: web-api
version: 2.3.0
enabled: true
replicas: 3
ports:
  - 80
  - 443
resources:
  limits:
    cpu: 500m
    memory: 512Mi
env:
  LOG_LEVEL: info
  FEATURE_FLAGS:
    - new-checkout
    - dark-mode
tags: null

Converted in this tab as you type. Nothing you paste or upload leaves this page.

Configs live on servers

Ship the config, manage the servers.

CtrlOps opens the servers your YAML deploys to: edit the file in place with the file manager, run the command, and watch the logs, all over your own SSH keys.

Explore File ManagerDownload for MacDownload for Windows

Keep it handy

JSON and YAML,
at a glance.

The same data in two notations: JSON for machines and APIs, YAML for the files people edit by hand.

How JSON and YAML compare
FeatureJSONYAML
CommentsNoYes ( # ... )
SyntaxBraces & bracketsIndentation
Quotes on keysAlways requiredUsually optional
Trailing commasNot allowedN/A
ReadabilityMediumHigh
Common useAPIs, configCI, Kubernetes, config

How the converter works

Same data.
Easier to read.

What this converter does

JSON and YAML describe the same things, maps, lists and values, so every JSON document has an exact YAML equivalent. The converter reads your JSON, keeps the keys in the order you wrote them, and writes YAML with the indentation you choose. Before showing the result it reads the YAML back and checks it matches your JSON value for value.

Why convert JSON to YAML at all?

YAML is easier to read and edit by hand, which is why Kubernetes, GitHub Actions, Docker Compose and Ansible use it for configuration. Converting a JSON API response, a package.json or an exported config removes the braces and quotes, and lets you add comments once it is a YAML file.

The values that trip YAML readers

Many tools still read YAML 1.1, where on, yes and NO are booleans, 2024-03-01 is a date and 012 is an octal number. Ansible, PyYAML, Ruby and older Kubernetes tooling all do this. So a country code NO left bare becomes false. Every string that could be misread in YAML 1.1 or 1.2 is quoted here; everything else stays bare and easy to read.

Numbers, comments and duplicate keys

Numbers are copied as written, so an ID like 123456789012345678901 keeps every digit, and 1e3 becomes 1.0e+3, the form YAML 1.1 also reads as a number. Files such as tsconfig.json may contain comments and trailing commas; those are read too, and each comment moves to its key as a # comment. A key that appears twice keeps the last value, as JSON.parse does, with a warning, because YAML cannot repeat a key.

Is it safe to paste config here?

Yes. The conversion runs entirely in your browser with no network calls, so it keeps working offline, and nothing you paste, upload or generate leaves the page. It is fine for real manifests, environment files and CI configs.

Check the result in the YAML validator

JSON & YAML FAQ

JSON to YAML,
explained.

Keep working

Related tools for your next task.

Your privacy preferences. We use product analytics to improve CtrlOps. Google measurement runs without analytics cookies. Live chat stays off until you allow it. Cookie policy