Convert YAML to JSON
Turn a YAML file into clean JSON in a click. Anchors are resolved, several documents become a list, and mistakes are pinpointed. Your config never leaves your browser.
- Free, every time
- No cloud processing
- Multi-document support
- Anchors resolved
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
YAML to JSON in three steps
No account, no email, no waiting for an upload.
- STEP 01
Paste or open your YAML
Use a .yaml, .yml or .txt file, or paste into the box.
- STEP 02
Choose the indent
Pick 2 spaces, 4 spaces or tabs for the JSON output.
- STEP 03
Copy or download the JSON
If the YAML has a syntax error, you see its line and column instead.
What YAML to JSON does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Several documentsA file with --- separators becomes a JSON list, one item per document, and the note says how many.
- Anchors, aliases and mergesValues defined once with & and reused with * are written out in full in the JSON.
- Errors with a positionBad indentation, tabs or duplicate keys are reported with the line and column.
- Dates become textTimestamps are written as ISO 8601 strings, which JSON can hold.
- Pretty outputThe result is indented, ready for an API request or a fixture.
Good to know
- Comments disappearJSON cannot hold them, so any comments in the YAML are dropped.
- Custom tagsApplication-specific tags that the parser does not know cause an error. Remove them or write plain values.
- Check the resultIf a value came out as a different type than you expected, see the quoting tips in the guide below.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use YAML to JSON
Test an API with a YAML example
Many docs show request bodies in YAML. Convert to JSON to send them.
Inspect a Kubernetes or CI file
See the exact data structure a YAML manifest produces.
Feed a JSON-only tool
Use YAML as the source, JSON as the delivery format.
Verify anchors
Confirm what a merge key actually expands to.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
What the converter understands
It reads the usual YAML features: nested maps and lists, multi-line strings, flow style like [a, b] and {x: 1}, quoted strings and the true, false and null words. Anchors and aliases are expanded, so JSON shows the final values.
If your file has several documents, you get a JSON array. A single document becomes a single JSON value.
Surprises worth knowing
YAML guesses types from plain text. That is convenient but can surprise you:
- Words such as yes and no are plain text in YAML 1.2, but some older YAML 1.1 parsers read them as booleans.
- A value like 0x1F can be read as a hexadecimal number. Quote it to keep it as text.
- A colon followed by a space inside an unquoted string starts a new key.
- Run YAML validator to see the structure, or tidy with the YAML formatter.
Using the JSON afterwards
Once converted, you can validate the data with the JSON schema validator, query it with the JSON path tester, or send it to an API. If the structure is not what you expected, the mismatch usually comes from indentation in the YAML, which a quick look at the JSON makes obvious.
Questions, answered
How do I convert YAML to JSON?
Paste the YAML and copy the JSON. Several documents become a JSON list.
Does it keep my YAML anchors?
Anchors and aliases are resolved, so the JSON shows the full data in each place. JSON has no equivalent.
Is a YAML file with credentials safe to convert here?
Yes. It is parsed by code in this tab and is never transmitted, so keys and passwords in it stay local.
What happens to comments?
They are dropped, since JSON has no comments.
How do I find a YAML error?
The message gives the line and column and a short reason, such as bad indentation.
Will it run on my iPhone or Android phone?
Yes, on current Safari and Chrome for iOS and Android. A pasted YAML file keeps its indentation.