About YAML to JSON
YAML is pleasant to write and painful to debug: one stray space can turn a nested mapping into a string, and a tab can break an entire document. Converting YAML to JSON gives you a second pair of eyes, because the JSON output only appears when the YAML parses cleanly and the structure it produces is immediately visible. It is also the quickest way to feed a Kubernetes manifest, CI configuration or OpenAPI file into a tool that only accepts JSON.
This converter parses the document with the same `yaml` library used across the JavaScript ecosystem, so anchors and aliases are resolved, comments are dropped and keys keep their written order. Everything runs in the browser: the file is read locally, the result is built locally and nothing is uploaded. YAML that is longer than 8 MB of text is refused instead of freezing the tab, and multi-document files are reported as an error because JSON cannot represent more than one root document.
What this tool does
Errors with line and column
A failed parse shows the line and column from the YAML parser plus a snippet of the offending source line, so indentation mistakes are easy to spot.
Paste or open a file
Paste YAML into the input pane or load a .yaml or .yml file from disk; the file is read locally and its name is reused for the JSON download.
Two-space indented JSON
The result is printed as readable JSON with two-space indentation, ready to paste into an API client, a config file or a code review.
Anchors and aliases resolved
YAML anchors and aliases are expanded by the parser, so the JSON contains the final values rather than the shorthand used in the source document.
Copy and download
Copy the converted JSON with one button or download it as a .json file whose name follows the uploaded YAML file.
Sample and clear
Load a small example document to see how the converter behaves, then clear both panes and start again with your own YAML.
How to use YAML to JSON
- 01
Paste or load YAML
Type YAML into the input pane, or drop a .yaml or .yml file to read it locally. Files above the 8 MB text limit are refused with a message.
- 02
Convert the document
Press Convert to JSON. The parser runs after the interface has painted, so a large document does not freeze the button state.
- 03
Fix any reported error
If the YAML is invalid, read the line and column in the error message, correct that part of the indentation and convert again.
- 04
Review the JSON
Read the indented output and check that arrays, nested mappings and scalar values came through in the shape you expected.
- 05
Copy or download
Copy the JSON to the clipboard or download it as a .json file; the downloaded name is based on the uploaded YAML file.
Supported formats and limits
- Input
- YAML
- Output
- JSON
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Maximum size
- Bound by the memory available to your browser tab.
- Requirements
- Chrome, Edge, Firefox or Safari · JavaScript enabled
Limitations worth knowing
- Accepts a single YAML document; multi-document files separated by --- are rejected.
- Comments are removed because JSON has no comment syntax, and YAML-specific types are reduced to the values JSON supports.
- Input is limited to 8 MB of text and the conversion runs on the main thread after a short yield.
- Output is always two-space indented JSON; there is no compact mode in this converter.
Privacy and file handling
Everything happens in your browser. The YAML file is read locally with the File API, parsed with JavaScript and converted to JSON in memory, so nothing is uploaded, stored or logged. Closing the page discards the input, the uploaded file and the result.
Read the full privacy policy