JSON ↔ YAML
Convert JSON to YAML and YAML back to JSON, locally, both ways.
Convert JSON configuration into YAML and back
This tool converts JSON into YAML and YAML back into JSON using js-yaml, the format most CI pipelines, Kubernetes manifests and docker-compose files are written in. Paste a JSON object and get YAML you can drop straight into a config file, or paste an existing YAML file and get JSON you can feed to a script. Conversion runs in a Web Worker in your browser, so config values, including secrets, stay local.
How to use the JSON ↔ YAML
- Paste JSON into the left panel, or load the example configuration.
- Click JSON → YAML to produce two-space-indented YAML on the right.
- Switch to YAML → JSON to parse an existing YAML file back into JSON.
- Use the swap button to flip direction without losing your current output.
YAML output uses two-space indentation with line wrapping disabled, so long strings stay on a single line instead of being folded. Object references aren't preserved as YAML anchors or aliases; if the same object appears twice in your JSON, it's written out twice in the YAML rather than linked.
Frequently asked questions
- Does the YAML output use anchors for repeated objects?
- No. The converter is configured with noRefs, so if the same object appears more than once in your JSON, it's written out in full at each location instead of being replaced with a YAML anchor and alias.
- Will long strings get wrapped onto multiple lines?
- No. Line wrapping is disabled, so a long string value stays on one YAML line regardless of length, which keeps things like URLs or JWTs from being split across lines.
- Can this tool convert YAML comments back into JSON?
- No. JSON has no concept of comments, so any comments in the YAML source are discarded when converting to JSON; only the underlying data carries over into the output.
- Is my configuration file uploaded anywhere during conversion?
- No. Both directions run in a Web Worker inside your browser tab, which matters if the YAML you're converting is a Kubernetes secret or a config file with credentials in it.