YAML ↔ JSON
Convert YAML to JSON and back.
Your YAML and JSON are converted locally in your browser and nothing is uploaded to a server.
Need to tidy up the result? Try the JSON Formatter.
About YAML ↔ JSON
This yaml to json converter turns YAML into clean, formatted JSON and converts JSON back into YAML with a single direction toggle. Paste a config file, Kubernetes manifest, CI pipeline, or API response and switch instantly to convert yaml to json or json to yaml. The JSON output is syntax highlighted and pretty-printed, ready to copy or download as a .json or .yaml file. It is built for developers, DevOps engineers, and QA testers who hop between the two formats while editing configs or debugging payloads. Conversion uses a standard YAML parser, so anchors and typed scalars are resolved correctly. Everything runs locally in your browser, so your data never leaves your device.
Features
- Converts YAML to JSON and JSON to YAML with a single direction toggle
- Live conversion that updates as you type, with no run button
- Pretty-prints JSON output with two-space indentation
- Syntax-highlighted JSON output for easier scanning
- Copy the result to your clipboard in one click
- Downloads output as a data.json or data.yaml file
- Inline error messages pinpoint invalid YAML or JSON input
- Resolves YAML anchors and typed scalars via a standard parser
How to use the YAML ↔ JSON
- Pick a direction with the YAML to JSON or JSON to YAML toggle at the top.
- Paste or type your source into the input box on the left.
- Read the converted output as it appears live on the right.
- Click the copy button or download the result as a .json or .yaml file.
- Press Clear to reset the input and start a new conversion.
Example
Input
name: ArrayKit
offline: true
tags:
- dev
- tools
Output
{
"name": "ArrayKit",
"offline": true,
"tags": [
"dev",
"tools"
]
}
YAML to JSON conversion of a small config block.
Common errors & troubleshooting
- Pasting multiple YAML documents separated by ---. — Only a single document is converted; if several are present the first one is used. Split the documents and convert them one at a time.
- YAML comments disappear after conversion. — Comments are dropped because JSON has no comment syntax. Keep an original copy of the YAML if you need to retain the comments.
- Invalid JSON error when converting to YAML. — Check for trailing commas, single quotes, or unquoted keys; the input must be strict, valid JSON before it can become YAML.
- Tabs in YAML cause a parse error. — YAML does not allow tabs for indentation. Replace tab characters with spaces and convert again.
Frequently asked questions
- What is a YAML to JSON converter?
- It is a tool that parses YAML and re-serializes it as equivalent JSON. This converter also runs in reverse, turning JSON back into YAML, so you can move between the two formats in one place.
- How do I convert JSON back to YAML with this tool?
- Set the direction toggle to JSON to YAML, then paste your JSON into the input box. The YAML output updates live and can be copied or downloaded as a .yaml file.
- Does this yaml to json converter support multi-document YAML?
- It converts a single document. If your input contains several documents separated by ---, only the first one is used in the output.
- Are YAML comments preserved in the JSON output?
- No. YAML comments are dropped during conversion because JSON does not support comments. Keep the original YAML if you need them.
- What indentation does the JSON output use?
- JSON is pretty-printed with two-space indentation so it stays readable and diff-friendly in version control.
- Is my YAML or JSON data uploaded anywhere when I use this converter?
- No. The conversion runs entirely in your browser, so your YAML and JSON never leave your device and nothing is uploaded to a server.
Related tools
- JSON Formatter — Beautify, minify and validate JSON with error locations.
- XML Formatter — Beautify, minify and validate XML, and convert XML ↔ JSON.
- JSON to CSV — Convert an array of flat JSON objects to CSV.
- JSON to Code — Generate Go, Rust, Python, Java, Kotlin, C# and TypeScript types from JSON.
- JSON Viewer — Text + collapsible tree viewer with expand/collapse and node paths.
- JSON Tree Viewer — Explore JSON as a collapsible, typed tree.
- Markdown Preview — Render Markdown to HTML with a live preview.
All ArrayKit tools