YAML ↔ JSON Converter
Convert data structures between YAML and JSON with instant parsing, formatting, and error feedback.
Input
Output
Tip: Use Ctrl/Cmd + Enter to run the currently selected conversion direction.
About YAML ↔ JSON Converter
YAML and JSON represent the same underlying data structures (objects, arrays, strings, numbers, booleans, null). This converter helps you move data between tooling ecosystems that prefer one format over the other.
How to Use
- Paste your YAML or JSON into the input panel.
- Click YAML → JSON or JSON → YAML to convert.
- The result appears in the output panel.
- Click Copy to copy the output to your clipboard.
How It Works
YAML-to-JSON uses the js-yaml library to parse YAML into a JavaScript object, then JSON.stringify() with indentation to produce formatted JSON. JSON-to-YAML reverses this: JSON.parse() then yaml.dump().
Example
YAML input:
name: Alice
age: 30
roles:
- admin
- editor
JSON output:
{ "name": "Alice", "age": 30, "roles": ["admin", "editor"] }
Frequently Asked Questions
YAML uses indentation and is more human-readable (great for config files). JSON uses braces/brackets and is more widely supported by APIs and programming libraries. Both represent the same data types.
YAML supports comments with the # character. JSON does not support comments. When converting YAML-with-comments to JSON, comments are stripped.
YAML-specific features like anchors (&), aliases (*), and multi-document streams are either flattened or may cause errors when converting to JSON, since JSON does not have equivalents.
No. All conversion happens in your browser. Your YAML or JSON data never leaves your device.