About the YAML to JSON Converter
This tool converts YAML configuration or data files into JSON using the well-established js-yaml library, and can also convert JSON back into YAML. It's useful for inspecting config files, migrating between formats, or debugging YAML syntax with a clear error message when parsing fails.
How to use it
- 01Paste YAML (or JSON, if converting the other direction).
- 02Choose the conversion direction and indentation width.
- 03Read, copy, or download the converted output.
Features
- YAML-to-JSON and JSON-to-YAML in one tool
- Friendly, specific error messages when YAML syntax is invalid
- Configurable 2 or 4 space indentation
- Download the result as a .json or .yaml file
Practical examples
Inspecting CI config
Convert a GitHub Actions or Docker Compose YAML file to JSON to inspect its exact structure.
Round-tripping config formats
Convert a JSON config into YAML for tools that expect that format, and back again.
Limitations
- YAML-specific features like anchors and multi-document streams are supported by the underlying parser, but only the first document is converted.
- Comments in YAML are discarded, since JSON has no comment syntax to preserve them.
Privacy
Conversion runs locally using the js-yaml library bundled with the page; nothing is uploaded.
Read the full privacy policy for how the site as a whole handles data.
Frequently asked questions
What happens if my YAML has a syntax error?
The parser reports a specific, human-readable error describing the location and nature of the problem.
Are comments preserved when converting to JSON?
No — JSON has no comment syntax, so YAML comments are dropped during conversion.
Can I convert JSON to YAML too?
Yes, switch the direction selector to JSON → YAML.