YAML to JSON Converter
Convert YAML to JSON — for config files, CI/CD, and API schemas
How to Use the YAML to JSON Converter
- Choose direction (YAML → JSON or JSON → YAML).
- Paste data and click Convert.
Supports common YAML features: key-value pairs, nested objects, lists, inline arrays/objects, block scalars (| and >), comments, and quoted strings. For complex YAML with anchors and aliases, consider a full YAML library.
What is YAML to JSON Conversion?
YAML (YAML Ain't Markup Language) is a human-friendly data serialisation format widely used in configuration files (Docker Compose, Kubernetes, GitHub Actions, Ansible). JSON is the standard data format for APIs and JavaScript. Converting between them is a common developer task when moving configs between tools.
Common Uses
- Converting Kubernetes or Docker Compose YAML to JSON for API submissions
- Transforming GitHub Actions workflow files for inspection or processing
- Converting OpenAPI/Swagger YAML specs to JSON format
- Debugging YAML config files by viewing them as JSON
Frequently Asked Questions
What is the main difference between YAML and JSON?
YAML is a superset of JSON — all valid JSON is valid YAML. YAML adds human-friendly features: no quotes needed for strings, comments (# syntax), multiline strings, and indentation-based structure instead of braces. JSON is stricter but universally supported by parsers.
Why does my YAML fail to convert?
Common issues: inconsistent indentation (mix of tabs and spaces), missing colons after keys, or special characters in unquoted strings. YAML is whitespace-sensitive — use spaces only, never tabs.
Can I convert JSON to YAML?
Yes. Aya Corporation supports bidirectional conversion. Paste valid JSON and it will be converted to properly indented YAML with correct formatting.
Notes from this implementation
One page, both directions
YAML-to-JSON and JSON-to-YAML used to be two URLs that loaded this same script. They are one page now. The direction control, or ?dir=json2yaml, chooses which parser runs. Separate landing pages only repeated the same widget with the nouns swapped, which is the pattern that gets a tool site treated as thin duplicate content.
The YAML parser in this file is a small indentation parser, not a full YAML 1.1 implementation. Anchors, merge keys, and complex keys are outside what it claims. Tabs for indentation will not do what spaces do. Quoted strings keep their text; unquoted yes, no, null, and numbers may become booleans, null, or numbers, which is the YAML behavior people trip over when a country code or a version is rewritten.
Round trip
Convert a small mapping to JSON and back. Key order and comments will not survive. If your YAML is a Kubernetes manifest with comments you need to keep, format it on the YAML formatter instead of converting it.