Why convert YAML and JSON?
YAML remains the default for many operations teams—Kubernetes manifests, GitHub Actions, Ansible inventories—while JSON dominates browser APIs and NoSQL document stores. Moving between the two formats is a daily task when you validate a cluster export in jq, diff configs, or embed the same structure inside a JSON-only pipeline.
This converter uses a mature YAML parser bundled with the page. Round-trips are intentionally conservative: advanced YAML features such as anchors, aliases, and custom tags may flatten when you serialize back out, so treat output as a structural representation rather than a byte-for-byte preservation of exotic YAML.
Ideal workflows
- Paste a service manifest, convert to JSON, and pipe through your organization’s JSON schema validator.
- Convert API examples from OpenAPI JSON snippets into readable YAML for documentation.
- Prototype config changes in YAML, then export JSON for tools that only accept JSON.
How to use this page
- Paste YAML or JSON into the editor depending on your starting format.
- Click YAML → JSON when the left editor contains YAML. Errors display parser hints inline.
- Click JSON → YAML when the editor contains valid JSON (objects, arrays, primitives).
- Copy the output once you confirm indentation and quoting meet downstream expectations.
Privacy
Parsing happens entirely in-browser. Clear the textarea after handling secrets such as sealed secrets or tokens—even though nothing is uploaded, shoulder surfing still matters.
Frequently asked questions
- Are YAML anchors preserved?
- Not reliably. The JSON intermediate representation expands anchors, and dumping back to YAML may inline values.
- Why does JSON → YAML wrap strings in quotes?
- The serializer chooses quoting when values look ambiguous to YAML (for example booleans or numbers).
- Can I convert multi-document YAML?
- Only the first document is supported in this UI. Split files manually for predictable results.
- Does this hit an API?
- No. Both directions run locally with bundled JavaScript.