Free JSON to YAML Converter
Convert JSON data into readable YAML in seconds. Paste your JSON below, get clean block-style YAML, and copy it straight into a configuration file or deployment manifest.
YAML output
Your input never leaves this device — the conversion runs entirely in your browser.
What JSON to YAML conversion does
JSON and YAML are both plain-text ways to describe structured data: objects with named fields, lists of values, strings, numbers, and true, false and null values. JSON marks structure with braces, brackets, commas and quoted keys. YAML marks the same structure with indentation and line breaks, which many people find easier to read in a configuration file.
Converting JSON to YAML keeps the data and changes only the notation. An object becomes a YAML mapping, an array becomes a sequence of items, and each string, number, boolean and null value carries over. The result is suited to files that expect YAML, such as Kubernetes manifests, continuous integration settings and Docker Compose files, where YAML is the normal format.
The conversion runs entirely in your browser. Your input never leaves your device, and nothing is uploaded to a server or stored. That also means the tool works on the text you paste, exactly as pasted, so invalid JSON must be fixed before conversion can succeed.
How to convert JSON to YAML
Follow these steps to convert a JSON document into YAML:
- Paste your JSON into the input area. You can also type a short document directly.
- Read the YAML result in the output area. If the input is not valid JSON, fix the reported problem first, then paste the corrected text again.
- Copy the YAML and paste it into your configuration file or editor.
- Save the file with a YAML extension and test it with the program that will read it, because that program is the final judge of whether the file is accepted.
- For a very large document, convert it in smaller parts if the page feels slow, and keep a copy of the original JSON until the YAML version is confirmed working.
Keep the original JSON file until you have tested the YAML output. If a value looks wrong after conversion, compare it with the original field by field instead of editing the YAML from memory.
Worked example: service settings
This short example shows a service setting in JSON and the equivalent YAML. Note how braces and commas disappear, list items start with a dash, and nested fields move one level deeper by indentation.
{
"service": "search",
"replicas": 3,
"enabled": true,
"tags": ["fast", "public"]
}service: search replicas: 3 enabled: true tags: - fast - public
The data is unchanged: the same four fields, the same values, and the same list order. Only the punctuation changed. A reader can now scan the settings line by line without counting braces.
Longer documents follow the same pattern at every level: each nested object indents further, and each list item gets its own dash line.
Rules, quoting and edge cases
The table below shows how each JSON value appears in YAML. Types are preserved: a string stays a string, a number stays a number, and true, false and null keep their meaning.
| JSON value | YAML result |
|---|---|
| Object | Mapping with indented fields |
| Array | Sequence with one dash item per value |
| String | Plain text, quoted when needed |
| Number | Number, written as a number |
| true or false | true or false |
| null | null |
Quoting matters. A string such as yes, 123 or 2026-01-01 would be misread if left bare, because YAML could treat it as a boolean, a number or a date-like value. Values that YAML would misread are quoted in the output, so they stay strings when the file is read back. Keys are preserved in the order they appear in the input, and the output uses block style, with one field per line and indentation for nesting.
JSON has no comments, anchors or multi-document markers, so none appear in the output. Unicode characters are preserved as written. Numbers are handled as JavaScript numbers during conversion, so extremely large integers may lose precision, and formatting details such as trailing zeros may change.
Common JSON to YAML mistakes
- Trailing commas: a comma after the last item in an object or array is valid in some programming languages but not in JSON. Remove it before converting.
- Unquoted keys or single quotes: JSON requires double-quoted keys and double-quoted strings. JavaScript-style objects with bare keys or single quotes will fail.
- Tabs in the YAML result: YAML does not allow tabs for indentation. If your editor inserts tabs when you paste, replace them with spaces and keep the indentation consistent.
- Breaking indentation while editing: moving a YAML line left or right changes its meaning. Edit values in place and check the nesting after any cut and paste.
- Expecting comments to survive: JSON documents have no comments, so there is nothing to carry over. Add YAML comments, starting with a hash sign, only after conversion, in the YAML file itself.
- Sending YAML where JSON is required: an API that expects JSON will reject YAML. Convert only when the destination format is YAML.
Frequently asked questions
Is converting JSON to YAML lossless?
The structure and values are preserved, and keys stay in their original order. Formatting details from the original text, such as spacing and the exact written form of numbers, are not preserved, because the data is parsed and written out again in YAML notation.
Can I convert the YAML back to JSON?
Yes. Paste the YAML into the YAML to JSON converter on this site to get JSON again. Keep the original file until you have checked the round trip, especially for strings that look like numbers or dates.
Why are some strings quoted in the YAML output?
Quoting protects strings that YAML would otherwise read as a different type, such as yes, a bare number, or a date-like value. The quotes keep the value a string when the YAML file is parsed.
Does my JSON leave my device?
No. Conversion runs in your browser, and your input is not uploaded or stored. You can still avoid pasting secrets such as passwords or private keys into any web page as a general habit.
What should I do if my JSON is invalid?
Fix the JSON first. Check for trailing commas, missing commas between items, unquoted keys, and unmatched braces or brackets, then try again. A validator can show where the text first breaks.
Can I use the output in Kubernetes or Docker Compose files?
Yes, YAML is the normal format for those files, but always test the result with the tool that will read it. Indentation must use spaces, and each program has its own required fields that conversion alone cannot supply.
What happens to large numbers?
Numbers pass through JavaScript number handling, so ordinary numbers convert normally, but extremely large integers may lose precision. If exact large integers matter, keep them as quoted strings in the source JSON and check the output carefully.



