YAML ↔ JSON Converter
Convert YAML to JSON or JSON to YAML instantly. Paste your input, see the result in real time, and copy or swap directions with one click.
When to use YAML vs JSON
YAML is preferred for configuration files — GitHub Actions, Kubernetes manifests, Docker Compose, Ansible playbooks — because it is easier for humans to read and write. JSON is the standard for REST APIs and data interchange because it is strict, unambiguous, and natively supported by every language.
What is preserved during conversion
All values, types (strings, numbers, booleans, nulls), nested objects, and arrays are preserved. YAML comments are not representable in JSON and are dropped. YAML anchors (&anchor) and aliases (*anchor) are resolved to their full values before output.
How to use
- Select the direction — YAML → JSON or JSON → YAML.
- Paste your content into the left panel.
- The converted output appears instantly in the right panel.
- Click the copy icon to copy the output, or Swap & flip to use the output as new input.
Examples
- Simple: Paste a GitHub Actions workflow YAML to see its equivalent JSON — useful for debugging or feeding into tools that require JSON config.
- Developer workflow: An API returns JSON. Convert it to YAML to use as a base for a Kubernetes ConfigMap, then edit and convert back before applying.
- Edge case: YAML bare strings like
yes,no,on, andoffare parsed as booleans. Quote them ('yes') if you need string values.
Conversion runs entirely in your browser using js-yaml — nothing is uploaded to any server.
Frequently Asked Questions
- What is the difference between YAML and JSON?
- Both YAML and JSON represent structured data. JSON uses curly braces and quotes and is more compact; YAML uses indentation and is more human-readable. YAML is a superset of JSON. YAML is common in config files (GitHub Actions, Kubernetes, Docker Compose) while JSON is standard for APIs.
- Does YAML to JSON conversion ever lose information?
- Some YAML features have no direct JSON equivalent — comments, multi-document files, and YAML-specific types. Comments are stripped during conversion. Anchors and aliases are resolved before output.
- Is my data sent to a server?
- No. Conversion happens entirely in your browser using the js-yaml library. Nothing is transmitted anywhere.