Embed this tool on your site
About this tool
JSON is what APIs speak; YAML is what humans and many config files use. This converter switches between the two for everyday data: nested objects, lists and plain values. It uses a small built-in parser rather than a full YAML library, so it covers block-style maps and lists, quoted and plain scalars, numbers, booleans, null and # comments. YAML features outside that subset — anchors and aliases, tags, block scalars (| and >) and flow collections ({} and []) — stop with a clear error instead of being converted silently. Tabs are read as four spaces, and --- separators are skipped, so convert one document at a time. Going from JSON to YAML, keys are written bare, strings that start with a digit, start with true, false or null, or contain YAML punctuation are double-quoted, and nested objects and lists of plain values are indented by two spaces. Everything runs in your browser, so Helm values and CI secrets never reach a remote server.
Why use it
Quick Two-Way Conversion: One input box and two buttons cover JSON → YAML and YAML → JSON, so you can translate a config snippet or an API response without installing a CLI.
Readable YAML Output: Objects become indented key: value blocks and lists of plain values become dash items. Strings that start with a digit or with true, false or null, or that contain YAML punctuation, are double-quoted so they stay strings.
Leading Zeros Stay Strings: When reading YAML, values like 007 or 02139 are kept as strings because only plain decimal numbers are converted to JSON numbers.
Refuses What It Cannot Handle: Anchors, aliases, tags, block scalars and flow collections produce an explicit error rather than a silently wrong conversion, so you know when to reach for a full YAML parser.
Secrets-Safe Local Parsing: Helm values, Vault configuration snippets, and CI secrets never leave your browser tab. The parser runs entirely in JavaScript memory — no fetch request, no server, no logs.
How to use
- Paste JSON or YAML into the source box
- Click JSON → YAML or YAML → JSON for the direction you need
- Read the result in the output pane — YAML → JSON output is indented with 2 spaces
- If the YAML cannot be parsed, read the error message, which names the line for indentation and key/value problems
- Click Copy to put the result on your clipboard, or Clear to start over
When it helps
- Translating a simple Kubernetes or docker-compose snippet from YAML to JSON when your tooling expects JSON input
- Turning a JSON config object into YAML for a CI file or an app settings file
- Porting small sections of an OpenAPI specification between YAML and JSON
- Checking how a YAML value will be typed (string, number, boolean or null) by looking at the JSON result
- Converting an API JSON response into YAML to add it as a fixture file in a YAML-based test suite
Examples
01Kubernetes manifest YAML → JSON
InputapiVersion: v1
kind: Service
metadata:
name: web
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: web
Expected result · Scroll for more{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": "web"
},
"spec": {
"ports": [
{
"port": 80,
"targetPort": 8080
}
],
"selector": {
"app": "web"
}
}
}
02API response JSON → YAML config
Input{"database":{"host":"db.local","port":5432,"ssl":true},"cache":{"driver":"redis","ttl":3600}}
Expected resultdatabase:
host: db.local
port: 5432
ssl: true
cache:
driver: redis
ttl: 3600
03List of plain values → YAML
Input{"name":"web","replicas":3,"tags":["frontend","api"]}
Expected resultname: web
replicas: 3
tags:
- frontend
- api
Tips
- Comments are a YAML-only concept — they are dropped when converting to JSON and cannot be reconstructed; keep originals in version control.
- If a value must stay a string for an older YAML 1.1 parser (on, off, yes, no), quote it in the source before converting.
- Use spaces, not tabs, for YAML indentation — this tool reads a tab as four spaces, but most YAML parsers reject tabs outright.
- Split multi-document files at each --- and convert the documents one by one.
- If the converter reports anchors, block scalars or flow collections as unsupported, expand them into plain block-style YAML first.
Frequently Asked Questions
Is YAML really just JSON with cleaner syntax?⌄
YAML 1.2 is a superset of JSON — every valid JSON document is also valid YAML. However, YAML adds features like comments, anchors, aliases, multi-document streams, and bare unquoted strings, which have no equivalent in JSON. These extras are why YAML is preferred for human-edited config files.
Which YAML features does the converter support?⌄
Block-style maps and lists, list items that start with key: value, single- and double-quoted strings, plain strings, numbers, true/false, null and ~, and # comments. Anchors and aliases, tags, block scalars (| and >) and flow collections ({} or []) are rejected with an error.
Why might NO or yes cause trouble in YAML?⌄
YAML 1.1 parsers treat bare NO, yes, on and off as booleans; YAML 1.2 only treats true and false that way. This converter only quotes strings that start with a digit or with true, false or null (or contain YAML punctuation), so a JSON string such as "NO" is written bare. Quote it by hand if an older parser will read the file.
How are JSON null values represented in YAML output?⌄
JSON null becomes the bare YAML value null. On the way back, null, Null, NULL, ~ and an empty value all become JSON null.
Will my comments survive the YAML → JSON → YAML round trip?⌄
No. Comments are a YAML-only concept and are discarded when converting to JSON because JSON has no comment syntax. They cannot be reconstructed on the way back. Keep the original YAML file in version control if comments matter.
Does it support Kubernetes-style multi-document YAML files?⌄
No. --- separators are skipped, so several documents are read as one map and later keys overwrite earlier ones. Paste and convert one document at a time.
Is the YAML output safe for lists of objects?⌄
Check it first. Lists of plain values are written correctly, but arrays whose items are objects or other arrays are written with extra spaces after the dash, which strict YAML parsers reject. Fix the indentation by hand for those sections.
Can I trust this with secrets from a Helm values.yaml file?⌄
Yes. The parser runs entirely in your browser — no data is sent to any server, and no request is made. Your API keys, database passwords, and Vault tokens stay in your browser tab memory and are cleared when you close the page.
Glossary
- YAML 1.2
- The current YAML specification that removes ambiguous implicit type rules from YAML 1.1, most notably restricting booleans to only true and false and fixing octal literal handling. Many modern YAML libraries follow it.
- Anchor (&)
- A YAML feature that names a node with &anchorName so it can be reused elsewhere. Anchors allow DRY config by defining a block once and referencing it multiple times via aliases.
- Alias (*)
- A YAML reference to a previously defined anchor, written as *anchorName. Full YAML parsers expand it to a copy of the anchored value; this converter does not support aliases and reports an error.
- Flow style vs block style
- Two ways to write the same YAML data. Flow style uses inline JSON-like syntax ({key: val}); block style uses indented lines. Block style is preferred for readability in config files; flow style is compact for short values.
- Multi-document stream
- A single YAML file containing multiple independent documents separated by --- delimiters. Common in Kubernetes when bundling related resources (Deployment + Service) into one file.
- Norway problem
- A YAML 1.1 quirk where the bare country code NO is parsed as boolean false because it matches the yes/no boolean set. Fixed in YAML 1.2, but still a risk when working with older parsers or tools.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.
Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.
✳
✳
✓ Free to use✓ No sign-up✓ 500+ possibilities