YAML ↔ JSON Converter
Convert between YAML and JSON in either direction. Useful for Kubernetes manifests, CI configs, and OpenAPI specs.
Enter input above to see the result.
What is this for?
YAML and JSON describe the same data structures — nested maps, lists, and primitive values — but with fundamentally different trade-offs. YAML prioritises human readability with minimal syntax; JSON prioritises strict, machine-parseable structure. This converter transforms between them losslessly for any structure both formats can express. It runs entirely in your browser using YAML 1.2 parsing, so no data leaves your machine.
When to use it
- Converting a Kubernetes manifest, docker-compose file, or GitHub Actions workflow from YAML into JSON for tooling that requires it.
- Taking an API response or configuration dump in JSON and reformatting it as YAML for readability or for use in a config file.
- Debugging ambiguous YAML indentation by converting to JSON to see the actual nesting structure.
- Validating OpenAPI specs or CloudFormation templates by converting to a more rigid format to catch syntax errors.
- Porting configuration between systems — exporting from a JSON API, converting to YAML for Kubernetes, then back to JSON for another tool.
- Auditing CI/CD pipeline configs where the intended structure is unclear from the YAML source alone.
How it works
- Paste or type your YAML or JSON into the input panel. The tool auto-detects the format.
- Click convert or set auto-convert on, and the output appears in real time on the right panel.
- Copy the result using the copy button, or download as a file.
- Round-trip safely — convert JSON to YAML and back. You'll get structurally identical JSON (though formatting may differ).
- Both directions run client-side; there is no server-side processing or logging.
Common gotchas
- The "Norway problem". YAML 1.1 coerced strings like
NO,YES,ON,OFFinto booleans automatically. YAML 1.2 treats them as strings, but older parsers downstream may not. Always quote ambiguous boolean-like strings to be safe:"yes"instead ofyes. - Multi-document YAML. YAML files can contain multiple documents separated by
---. This converter processes only the first document. If your YAML has multiple---separators, split it first and convert documents individually. - Custom YAML tags. Tags like
!!python/object,!Ref,!Sub, or!CustomTypeare extensions that violate strict YAML 1.2. CloudFormation intrinsic functions and PyYAML pickle dumps will fail. Remove or replace custom tags before converting, or post-process the JSON to restore them. - Anchors and aliases expand on conversion. YAML supports references with
&anchorand*aliassyntax, but JSON has no equivalent. Converting YAML to JSON inlines all aliases, making the output larger but structurally identical. Round-tripping YAML through JSON will lose the anchor/alias syntax. - Unquoted numbers and strings. In YAML,
3.14is a float andtrueis a boolean, but"3.14"and"true"are strings. JSON respects these types strictly. If your JSON needs string versions of numbers, quote them in YAML first.
Limitations and workarounds
- If conversion fails, check your syntax — the error message will point to the problematic line.
- For very large files (10+ MB), performance may degrade. Most real-world configs convert instantly.
- Preserve comments by converting YAML to JSON, manually noting comments, then converting back — comments don't survive JSON.