YAML to JSON Converter
Convert YAML to JSON and JSON to YAML, bidirectionally, with key order preserved and multi-document YAML support.
YAML to JSON and JSON to YAML, One Tool
YAML and JSON represent the same kind of data — objects, arrays, strings, numbers, booleans, and null — in two different syntaxes. YAML is a strict superset of JSON in flow style, which means the conversion between them is lossless for ordinary data: every JSON document is already valid YAML, and any YAML document without YAML-only features like anchors, aliases, or comments converts to JSON with nothing left out.
This tool converts in both directions from a single page. Switch to YAML → JSON to parse YAML with js-yaml and pretty-print it as JSON, or switch to JSON → YAML to parse JSON natively and dump it as clean, indented YAML. Key order is preserved in both directions — nothing sorts your keys — so round-tripping a document gets you back the same structure you started with.
Multi-document YAML files — the ---separated format Kubernetes manifests commonly use to bundle several resources in one file — convert to a JSON array, one entry per document. Converting a plain JSON array back always produces a single YAML document containing a list, since a top-level array can't be reliably told apart from genuine multi-document YAML once it's JSON — this keeps the conversion predictable instead of guessing at document boundaries that may never have existed.
Paste YAML or JSON — or drag and drop a file — and the conversion runs instantly as you type, entirely in your browser. Nothing is uploaded to a server.
Why Convert Between YAML and JSON?
Move Between Config Formats
Kubernetes manifests, CI configs, and API payloads increasingly live in both YAML and JSON across a toolchain. Converting between them by hand is slow and easy to get wrong.
Debug with the Format You Know
JSON is easier to diff, grep, and feed into scripts and jq pipelines; YAML is easier to hand-edit. Converting lets you work in whichever is more convenient for the task at hand.
Feed YAML Into JSON-Only Tools
Many APIs, linters, and JSON Schema validators only accept JSON. Converting a YAML config first lets you use them without maintaining a second copy by hand.
Round-Trip Without Losing Order
Key order affects readability and, in some tools, behavior. This converter never sorts keys, so converting there and back reproduces the same order you started with.
Example
The same data, in both formats — nested objects, arrays, and scalar values convert cleanly in either direction.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
labels:
app: web
spec:
replicas: 3
template:
spec:
containers:
- name: web
image: nginx:1.25
ports:
- containerPort: 80{
"user": {
"id": 42,
"name": "Jane Doe",
"active": true,
"roles": ["admin", "editor"],
"address": {
"city": "London",
"country": "UK"
}
}
}Features
Bidirectional Conversion
Convert YAML to JSON or JSON to YAML from the same page — just switch direction.
Key Order Preserved
Keys keep their original order on the way over and on the way back, since nothing sorts or reorders them.
Multi-Document YAML
A ---separated YAML file converts to a JSON array — one entry per document.
Upload a File
Drag and drop or upload a .yaml/.yml or .json file depending on the direction.
Copy / Download Output
Copy the result or download it as a standalone .json or .yaml file.
Clear Error States
Invalid YAML and invalid JSON are reported separately and labeled for whichever direction you’re converting.