YAML to JSON
From config file to API payload.
Paste a Kubernetes manifest, a CI pipeline or any other YAML document and get formatted JSON back — ready to send to an API, load in code or explore in the viewer.
Anchors, aliases and merge keys are supported. Object-instantiating tags are rejected, and comments are dropped since JSON has no comment syntax.
Input YAML
JSON output
Paste YAML to see the output.
How to convert YAML to JSON
- Paste your YAML, or drop a .yaml or .yml file onto the editor.
- The JSON output appears immediately; syntax problems are reported with a line and column.
- Choose an indentation width, then copy or download the result.
What changes in the conversion
- Comments are dropped — JSON has no comment syntax.
- Anchors and aliases are expanded, so a referenced block is written out in full at each use.
- Multi-document YAML files (separated by ---) convert one document at a time; JSON holds a single root value.
- Timestamps become ISO 8601 strings and binary scalars become base64 strings, since JSON has neither type.
Common YAML errors
- Tab characters used for indentation — YAML requires spaces.
- Inconsistent indentation between sibling keys.
- A missing space after a colon:
key:valueis a single scalar, not a mapping. - Duplicate keys in the same mapping.
Safety
Anchors, aliases and merge keys are supported, but the object-instantiating tags that have caused remote-code-execution bugs in other YAML tooling are not part of this build. An unknown tag such as !!js/function is rejected outright, so a hostile YAML file cannot execute anything in your browser.
Frequently asked questions
Are YAML comments kept?
No. JSON has no comment syntax, so comments are discarded during conversion.
Can I convert a multi-document YAML file?
JSON has a single root value, so convert one document at a time — split the file on the --- separators.
Is the converter safe against malicious YAML?
Yes. Anchors, aliases and merge keys work, but tags that instantiate objects are not part of this build and an unknown tag is rejected rather than evaluated.
Related JSON tools
- JSON to YAMLConvert JSON into readable YAML.
- JSON FormatterPretty-print messy JSON with your choice of indentation.
- JSON ViewerExplore JSON as a collapsible tree with search and copyable paths.
- JSON ValidatorCheck syntax with precise line, column and cause.
- JSON Schema GeneratorInfer a JSON Schema from a sample document.