YAML ⇄ JSON Converter
Convert YAML configuration files to JSON, or JSON objects into clean, indented YAML. Handles files up to 200MB.
Or convert a file directly — supports files up to 200MB
Drag & drop a file here, or click to browse
Processed in the background, so the page stays responsive even for huge files
How to use this tool
Choose YAML → JSON or JSON → YAML, then paste or upload; the other pane follows as you type. YAML → JSON is handy for inspecting Kubernetes manifests, CI configs, or Docker Compose files as plain JSON; JSON → YAML is useful for turning API responses into readable config files. Syntax errors are reported with a clear message.
Worked example: what YAML → JSON changes
A small service config:
# owner: payments team service: billing-api enabled: yes debug: on active: true version: 1.10 port: 08080 zip: "073301"
converts to:
{
"service": "billing-api",
"enabled": "yes",
"debug": "on",
"active": true,
"version": 1.1,
"port": 8080,
"zip": "073301"
}- The comment is gone. JSON has no comment syntax, so the owner note can't come along.
yesandonstay strings. The parser follows YAML 1.2, where onlytrueandfalseare booleans. A tool that reads YAML 1.1 treatsyes,no,onandoffas booleans too, so the same file can mean different things to two programs. Writetrueorfalsewhen you mean a switch.- Unquoted numbers lose their formatting:
1.10becomes1.1and08080becomes8080. The quoted"073301"stays a string with its leading zero, so quote anything that is a label rather than a quantity.
JSON → YAML: the quotes that keep values safe
Going the other way, the converter quotes any string that another YAML reader could take as something else. This JSON:
{"switch": "on", "answer": "yes", "enabled": true, "version": "1.10", "zip": "073301"}switch: 'on' answer: 'yes' enabled: true version: '1.10' zip: '073301'
The strings "on" and "yes" are quoted so a YAML 1.1 tool doesn't turn them into true, and "1.10" and "073301" are quoted so they don't become numbers. The real boolean true stays unquoted.
Frequently Asked Questions
Why do so many config file formats (Kubernetes, Docker Compose, CI pipelines) use YAML instead of JSON?
YAML was designed to be easy for humans to write and read by hand — no braces, no required quotes around most strings, and indentation instead of punctuation to show nesting. JSON is easier for machines to parse unambiguously and is the standard for APIs, but its brackets and quotes make longer hand-written config files more tedious to write and review than the equivalent YAML.
Does converting JSON to YAML preserve data types correctly?
Yes — numbers stay unquoted numbers, booleans stay true/false, and strings that could be misread as another type (like the ZIP code "73301", which looks numeric) are quoted to preserve their intended type. This matters because an unquoted numeric-looking string can silently become an actual number when a YAML file is later parsed by something else.
Why does my YAML → JSON conversion fail with an indentation error?
YAML uses indentation to represent nesting, so unlike JSON's braces, a single misplaced space changes what a line belongs to. A tab used for indentation is always an error, because YAML allows only spaces there; a list item indented too deep can be valid YAML that means something else, with no error at all: "- banana" pushed two spaces right under "- apple" turns the list into the single string "apple - banana". When there is an error, it ends with (line:column), such as (2:1) for a tab at the start of line 2.
Related Tools
Related Blog Posts
How to Convert JSON to Excel, CSV, XML and YAML (and Back)
What actually happens to your data when JSON becomes a spreadsheet, XML, or YAML: missing keys, nested values, leading zeros, and the XML array problem, with real converter output.
Read moreConverting CSV and XML to Excel Without Losing Data
Why double-clicking a CSV mangles PIN codes, long IDs and ₹ signs, what a careful CSV-to-Excel conversion does instead, and how XML records map to spreadsheet columns.
Read moreHow to Flatten Nested JSON and Convert JSONL Files
How dot-notation flattening turns nested objects and arrays into spreadsheet columns, what survives the trip back, and how JSON Lines differs from a normal JSON file.
Read more