# YAML to JSON

Convert YAML to JSON, including multi document streams and anchors. Broken YAML gets a line and column. Nothing you paste is uploaded.

Canonical page: https://filetity.com/yaml-to-json

## Capabilities

- Free: Yes, with no watermark and no page limit.
- Account required: No. There is no account system.
- Processed on device: Yes. The file is read by your browser and never uploaded. There is no server to send it to.
- Formats: YAML in, including anchors, aliases, block scalars and multi document streams. Indented JSON out.
- Limits: No size limit beyond what your browser will hold. Comments are dropped, because JSON has nowhere to put them.
- Mobile: Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
- Offline: Yes, once the page has loaded. The tool keeps working with no network connection.

## Questions

### What happens to a file with several documents in it?

They become an array, and the page tells you how many there were. A stream separated by three dashes is normal in Kubernetes output, and JSON has no way to express one, so the alternative is keeping the first document and silently dropping the rest, which is what a plain load call does.

### Why did my version number become a number?

Because YAML types unquoted scalars, so 1.10 is the number 1.1 and the trailing zero is gone. That is the format rather than the tool, and it is the single most common YAML surprise. Quote it in the YAML and it stays a string all the way through.

### Does it handle anchors and aliases?

Yes. An anchor defines a value and an alias reuses it, and the conversion expands them, so the JSON contains the value everywhere the alias appeared. JSON has no way to reference a value from elsewhere in the same document, so expanding is the only faithful answer.

### What do I get when the YAML is broken?

The line and column where parsing stopped, and what was wrong there. Indentation errors and a tab used for indentation are the two most common causes, and YAML forbids tabs for indentation entirely, which catches people whose editor inserts them.

### Is it safe to paste a manifest with secrets in it?

It goes nowhere. There is no upload and no request in the path, so the document lives in the tab and disappears when you close it. That is the reason this exists rather than pointing you at one of the many converters that post your YAML to a server.

## Related tools

- [JSON to YAML](https://filetity.com/json-to-yaml): Convert JSON to readable YAML, with no folded lines.
- [JSON Formatter and Validator](https://filetity.com/json-formatter): Format, beautify, validate and read JSON, and find the line that broke it.
