JSON ↔ YAML
Convert JSON to YAML or YAML back to JSON. Great for editing config files. The YAML parser supports block-style maps, sequences and scalars.
Convert JSON to YAML (and back) in the browser
JSON is what APIs and programs speak; YAML is what humans prefer to edit. Configuration for Kubernetes, GitHub Actions, GitLab CI, Docker Compose, Ansible and countless other tools is written in YAML precisely because it is less noisy than JSON — no braces, no quotes around keys, and comments are allowed. This converter moves data between the two formats both ways, so you can take an API response and turn it into a readable config file, or take a YAML manifest and feed it to something that only understands JSON.
How to use it
- Pick a direction with the selector above — JSON → YAML or YAML → JSON.
- Paste your document into the input box, or click Load sample to try it with example data.
- The converted result appears instantly on the right. Use Copy or Download to grab it.
A worked example
This JSON object:
{ "id": 10, "name": "Ada Lovelace", "roles": ["admin", "developer"] }becomes this YAML:
id: 10
name: Ada Lovelace
roles:
- admin
- developerNotice how the object keys lose their quotes, the array turns into a dash-prefixed sequence, and the whole thing becomes noticeably easier to scan — which is exactly why config files use YAML.
When you would reach for it
Drafting a Kubernetes or Compose file from a JSON snippet you found in documentation, converting a YAML CI pipeline so you can validate it with a JSON-schema tool, or simply reformatting a dense JSON blob into something a teammate can read in a pull request. Because the output is plain text, it pairs naturally with the JSON editor for validation and with the JSON Schema generator when you want to lock down the shape of a config.
Privacy
The conversion runs client-side in JavaScript and then works offline. Your JSON or YAML is never uploaded, logged or stored, so it is safe to convert manifests that contain internal hostnames, environment names or other details you would not paste into an upload-based site.
Frequently asked questions
Does it support the full YAML spec?
It covers the common subset — block mappings, sequences and scalars — which handles the vast majority of config files. Anchors (&/*), custom tags and complex flow syntax are not supported, so if you rely on those, convert the simpler parts here and merge the advanced pieces by hand.
Which direction should I use?
Use JSON → YAML to turn an API response or package.json-style file into readable config, and YAML → JSON when a tool or API only accepts JSON but your source of truth is a YAML file (a Kubernetes manifest, a CI pipeline, a Docker Compose file).
How are data types preserved?
Round-tripping keeps numbers, booleans and null intact: true stays a boolean, 42 stays a number, and an empty value becomes null. Quoted strings that look like numbers (for example a ZIP code) stay strings.
Why does my converted YAML use two-space indentation?
Two spaces is the de-facto community standard used by Kubernetes, GitHub Actions and most linters. YAML forbids tabs for indentation, so the converter always emits spaces.
Does it keep comments from my YAML?
No. JSON has no concept of comments, so when you convert YAML → JSON any # comments are dropped. Keep a copy of the original if the comments matter.
Is my data uploaded?
No. Conversion happens entirely in your browser — the JSON or YAML you paste never leaves your device.