YAML ↔ JSON
Convert YAML to JSON and back in the tab with js-yaml.
Runs in this tab. The file stays here.
This runs in your browser. Nothing is uploaded.
About YAML ↔ JSON
Converts YAML to JSON and JSON to YAML in your browser using js-yaml, so a config never has to be pasted into an online converter.
Kubernetes manifests, CI configs, and Ansible playbooks still arrive as YAML in chat while the tool you actually have open speaks JSON. The conversion is a small script everyone rewrites, or a website that asks you to upload the production config. I got tired of both. Paste YAML, get indented JSON. Paste JSON, get YAML with a reasonable line width. js-yaml does the parsing and dumping in the tab; the document never leaves the machine. That matters when the file names a cluster, a database host, or a token placeholder you still do not want on a stranger's disk.
Direction is explicit. YAML that happens to look like JSON is still YAML when you pick YAML to JSON. JSON with trailing commas will fail here the same way JSON.parse fails everywhere, because the JSON direction is strict JSON, not JSON5. Anchors and aliases that js-yaml understands round-trip when the data model allows; exotic YAML tags may collapse to strings or objects in ways that surprise you if you expected a custom type. Numbers that must stay strings in YAML should stay quoted in the source; JSON will not preserve your quoting intent on the way back. Empty documents and null scalars behave the way js-yaml parses them, which is usually what you want for configs and rarely what you want for arbitrary YAML trivia.
I didn't add a schema validator, a multi-document splitter, or a 'detect dialect' button. Those belong in an editor or a CI linter. This is the converter I want when someone pastes a deployment file and I need to grep the JSON, or when a JSON fixture has to become a readable YAML sample for a README. If the parse fails, you get an error message instead of a half-converted mess. Run the JSON formatter next if you want minify or a stricter second opinion on the JSON side. Nothing is stored after you leave; treat the output like any other clipboard paste from a config repo.
How to use YAML ↔ JSON
- 1Paste YAML or JSON into the panel, or load a .yaml, .yml, or .json file.
- 2Choose YAML to JSON or JSON to YAML.
- 3Copy the result, or fix the source if the parser reports an error.
What it won't do
- js-yaml semantics, not every YAML dialect or custom tag.
- Strict JSON on the JSON to YAML path; no JSON5, no trailing commas.
Common questions
Which YAML library does this converter use?
js-yaml in the browser. That covers most everyday configs. It is not every edge case of every YAML 1.2 engine in the wild; if your file uses a rare tag or a dialect your cluster rejects, validate in the environment that will actually run it.
Will multi-document YAML files convert cleanly?
js-yaml load returns one document by default. A file with --- separators may not become a JSON array of documents here. Split the documents yourself if you need each one separately.
Does converting YAML to JSON change the data?
It changes the syntax, not the scalar values js-yaml parsed. Key order in JSON follows stringify rules. Comments in YAML are discarded because JSON has no comment syntax. Numbers and booleans become JSON types; be careful if you relied on YAML quoting to keep an ID as a string.
Related tools
Why this one doesn't upload your file
There is no server to upload to. This page is a static file, and the work happens in your browser using the same graphics and WebAssembly code that renders every other site you visit. Your file is read from disk into memory, processed, and handed back as a download. Once the page has loaded you can disconnect from the network entirely and it keeps working. The longer explanation