JSON ⇄ YAML Converter
Translate configuration files cleanly between JSON and YAML 1.2 in both directions in your browser using js-yaml — nothing is ever uploaded.
Convert JSON to clean, readable YAML — or parse YAML back into valid, formatted JSON — right in your browser. Built on the standard js-yaml 4 parser trusted across CI pipelines, the converter preserves nested objects, arrays, numbers, booleans, anchors, and multi-line strings accurately while reporting syntax errors with exact line details. Nothing is uploaded, so Kubernetes manifests, Docker Compose files, and API payloads stay on your machine.
How to use JSON ⇄ YAML Converter
- Paste your JSON or YAML into the Input editor.
- Click JSON → YAML to dump clean 2-space YAML, or click YAML → JSON to parse YAML into formatted JSON.
- Review the Output box — if the input contains a syntax mistake such as a missing colon or bad indentation, the parser’s exact error line appears immediately.
- Click Copy result to place the converted config on your clipboard.
Who it is for
Developers, DevOps engineers, and technical writers moving between configuration ecosystems: converting OpenAPI or Swagger specs between JSON and YAML, turning an API response into a Kubernetes or GitHub Actions config block, or validating a hand-edited docker-compose.yml before pushing it to CI.
How it works
- Parsing and serialization run locally in your browser using js-yaml 4, supporting standard YAML 1.2 data types, multi-line block scalars, and strict RFC 8259 JSON output with 2-space indentation.
- In YAML → JSON mode, YAML anchors and aliases (&anchor / *alias) are resolved into standard JSON objects so the output is completely self-contained and strictly valid JSON.
- In JSON → YAML mode, keys and strings that another YAML parser could misread as booleans or numbers (like yes, no, on, or leading-zero strings) are quoted automatically to prevent silent type corruption.
What it cannot do
- Comments (# ...) in YAML are lost when converting to JSON because the JSON specification does not support comments.
- Multi-document YAML streams separated by --- need to be converted one document at a time, since standard JSON expects a single top-level value.
- Custom application-specific YAML tags (such as AWS CloudFormation !Ref or !Sub) are outside standard YAML types and trigger a parse error unless quoted.
Frequently asked questions
Why did my YAML comments disappear after converting to JSON?
Standard JSON has no comment syntax. Any # comments in a YAML document are stripped during parsing so the resulting JSON passes strict validation.
Does it support YAML anchors and aliases?
Yes. Anchors (&) and aliases (*) are expanded into their full values when converting YAML to JSON, ensuring the output is self-contained and valid.
Why are some strings wrapped in quotes in the YAML output?
js-yaml quotes words like yes, no, on, off, true, or null when they are strings so another YAML 1.1 or 1.2 parser will not accidentally convert your text into a boolean.
Is it safe to paste Kubernetes configs or API payloads here?
Conversion runs completely locally in your browser tab and nothing is ever transmitted to a server. Even so, good security hygiene is to keep production secrets out of any browser tab when possible.