Type a tool name, for example "keyword density" or "transcript".
Convert YAML to JSON or JSON back to YAML, useful for editing CI configs, Docker Compose, and Kubernetes manifests.
Uses YAML 1.2. Input stays in your browser. Non-finite numbers, unsafe integers, non-string map keys and cyclic aliases cannot be represented safely in JSON and are rejected.
This YAML JSON converter turns YAML into JSON, or JSON back into YAML, with one click. Paste your text, pick a direction, and copy the result. It is built for developers who edit Kubernetes manifests, Docker Compose files, CI pipelines and OpenAPI specs and need a fast, readable conversion.
YAML and JSON are two text formats for storing structured data such as objects, lists, strings, numbers, booleans and null. JSON uses braces, brackets and quotes. YAML uses indentation and dashes, which makes it easier to read and to comment by hand.
The two formats are closely related. YAML 1.2, the version this tool uses, was designed so that almost any valid JSON document is also valid YAML. The reverse is not true: YAML has features JSON lacks, such as comments, anchors and aliases, and keys that are not strings.
That gap matters when you convert. Anything JSON cannot hold has to be dropped, expanded or rejected, and knowing which of the three happens saves you debugging time.
true, null and numbers like 42 become real booleans, nulls and numbers.You convert by pasting text into the Input box and clicking the button for the direction you want. The steps below match the controls on this page.
The tool needs something in the Input box. If it is empty, you see "Paste input first." Input must also be 1 MB or smaller.
A realistic test is a short service config with a shared defaults block. Paste this YAML into the Input box:
name: my-appversion: 1.0.0ports:- 80- 443defaults: &defaults retries: 3 timeout: 30service: <<: *defaults timeout: 60
Click YAML → JSON. The JSON Output contains "name": "my-app", a "version" of "1.0.0" and "ports": [80, 443]. The service object comes out with "retries": 3 and "timeout": 60.
Three things are worth noticing. Version 1.0.0 is a string because it is not a valid number. The ports are real numbers, so they have no quotes. The alias was expanded, and the local timeout: 60 overrode the default of 30, so the JSON carries no trace of the anchor.
Now click Swap and then JSON → YAML. You get clean block-style YAML again, without the anchor. Repeated blocks are written out in full, so the file is longer but has no references to maintain.
A successful conversion shows "Converted successfully." and an output panel. A failed one shows "Conversion failed:" with a reason. Most reasons fall into a few groups, and each has a quick fix.
| Message | Cause | Fix |
|---|---|---|
| JSON objects require string map keys. | A YAML key is a number, boolean or null | Quote the key, such as "200" |
| A number cannot be represented safely in JSON. | An integer is too large, or a value is infinite or not a number | Wrap large IDs in quotes |
| Cyclic aliases cannot be represented in JSON. | An alias refers back to its own parent | Remove the circular reference |
| Expanded document exceeds 50000 values. | Aliases expand into a very large tree | Reduce alias reuse or split the file |
| Input must be 1 MB or smaller. | The pasted text is too big | Convert it in smaller parts |
Syntax errors from the parser, such as a bad indent or an unclosed quote, also appear in the status line. For JSON input that will not parse, the usual culprits are trailing commas, single quotes and unquoted keys. Fix those first, or run the text through a JSON formatter and validator to find the exact line.
If a value converts to the wrong type, look at the quotes. A bare 08 or 1e3 may be read as a number, while "08" stays text. If you need a string, quote it in the source. Words like yes and no stay strings under YAML 1.2, while true and false become booleans.
Use YAML when people edit the file by hand, and JSON when programs exchange the data. YAML is easier to read and allows comments, which is why Kubernetes, Docker Compose and many CI systems use it. JSON is stricter and has fewer surprises, which is why it dominates web APIs and browser code.
Indentation errors are the main risk in YAML, because a single misplaced space can change the meaning of a document. JSON's brackets and quotes make structure explicit, but the format has no comments and no trailing commas. Converting between the two lets you write in the format that suits you and ship in the format the target system needs.
The converter fits any job where the same data must live in both formats. These are the situations where it earns its place:
If your source data is XML or a spreadsheet instead, the XML to JSON converter and the CSV to JSON converter cover those first steps. You can then bring the JSON back here to produce YAML.
A few habits make conversions predictable and keep surprises out of your configs.
If the output looks wrong but no error appears, check the types first. Most mismatches come from an unquoted value that was read as a number or boolean.
This converter handles one YAML or JSON document per conversion, up to 1 MB of input. It deals with data only. It does not validate your file against a schema, such as a Kubernetes resource definition or an OpenAPI rule set, so a file can convert cleanly and still be invalid for its target system.
Some YAML content cannot become JSON at all. That includes non-string keys, circular aliases, infinite numbers and integers beyond the safe range. In those cases the tool stops with an error instead of producing output that might be silently wrong. For more utilities like this, browse the web developer tools collection, and use the code beautifier when you only need to tidy markup or scripts.
Paste your config into the Input box above, choose YAML → JSON or JSON → YAML, and copy a clean result in seconds. If something fails, the status message tells you what to fix.
Your report has been submitted. We will look into this issue.
A VPN changes your network exit. It does not guarantee anonymity.
Themes, plugins, code, video, audio, graphics & more from 90,000+ authors.
Web Development
Design & Media
Unlimited Access
Explore Envato MarketUses YAML 1.2 core scalar rules, merge aliases and string-key maps. Literal and folded blocks preserve their parsed meaning. Cyclic aliases, unsafe JSON numbers and non-string keys are rejected. Limits: 1 MB input and 50,000 expanded values.
Implementation reviewed: 4 October 2026. Source documentation