YAML to JSON converter
Rewrite a YAML file as JSON for tools that cannot read YAML.
Processed in your browser. This file is converted on your device and is never uploaded.
Converter
.yaml, .yml up to 25 MB. You can also drag a file here.
No file selected.
About this tool
Plenty of tools emit YAML but only accept JSON, and YAML's whitespace rules make it easy to write a file that looks right and parses wrong. This tool converts a YAML document to JSON and, when the file will not parse, tells you which line and column to look at.
It reads YAML 1.2, the version that treats JSON as a valid subset, so a JSON file passed to it comes back unchanged apart from formatting.
Supported formats and limits
- Input
- .yaml, .yml
- Output
- .json (application/json)
- Output name
- The original name with the new extension, for example data.yaml becomes data.json.
- File size limit
- 25 MB
- Processing
- In your browser. The file is not uploaded.
How to use it
- Choose a .yaml or .yml file, or switch to Paste text and paste the document directly.
- Choose whether to indent the JSON.
- Select Convert, then download the .json file.
Limitations
- Comments are discarded. JSON has no way to represent them.
- Only the first document in a file is converted. Multi-document YAML separated by --- is not supported.
- Anchors and aliases are expanded into full copies, so a document that reused a block through an alias grows larger.
- Dates and other YAML-specific types become strings, because JSON has no date type.
- Keys that are not strings, which YAML permits, cannot be represented in JSON.
Frequently asked questions
- Is my file uploaded?
- No. The conversion runs entirely in your browser. The file never leaves your device and no request carrying its contents is made.
- What happens if my YAML is invalid?
- Nothing is converted and the error names the line and column where parsing stopped, which is usually where the indentation went wrong.
- Can I convert a Kubernetes manifest?
- A single manifest, yes. Files containing several manifests separated by --- are not supported; split them first.
- Why did my unquoted country code become a boolean?
- YAML 1.1 read no as false, and some editors still write files that way. This tool uses YAML 1.2, where no stays the string "no". If a value matters, quote it in the source.