ALL DEVELOPER TOOLS56
YAML to JSON
YAML to JSON Converter — Free & Instant
Drop a .yaml file or paste it in, and get JSON — with every key, anchor and timestamp the two formats disagree about counted on screen.
About YAML to JSON
YAML and JSON describe the same kinds of data, but they do not describe them the same way, and the interesting part of converting one to the other is what happens where they disagree. A YAML stream can hold several documents separated by three dashes and JSON cannot, so a multi-document file comes out as a JSON array and the count is printed rather than assumed. YAML keys can be numbers, booleans, dates or whole sequences, while JSON keys are strings only, so any key that is not one is found in the source and listed with the string it becomes. A date key is the one to look at: it is converted through your own machine's time zone and locale, which is not something to discover a week later. Anchors and aliases are one node referenced twice, and JSON has no way to say that, so each alias is expanded and counted, which is exactly why the output is larger than the input. A cyclic anchor stops the conversion outright with the path named, instead of throwing somewhere nobody looks. Timestamps become ISO strings with a time attached. The parsing is js-yaml, reading its safe default schema, and the whole run happens in this tab — the file is never sent anywhere, and the same page converts back the other way with one click.
Questions
My file has --- separators and every other converter chokes on it.
Because most of them call the parser's single-document entry point, which throws "expected a single document in the stream" the moment it meets the second one. This page reads the whole stream instead and tells you how many documents came out. JSON has no document separator, so more than one can only be written as a JSON array — that is what you get, with the count printed above the panes. If your consumer expects a single object, read the array's first element rather than assuming the rest were never there.
Why is my JSON so much bigger than the YAML it came from?
Almost certainly anchors. An anchor and alias pair (&defaults and *defaults) stores a block once and points at it from everywhere else, and JSON has no way to express a reference — so every alias is written out as a full copy of the block. The count of expanded aliases is shown on screen for exactly this reason. It also changes the meaning slightly: in the YAML those were one node, so editing it changed every user of it; in the JSON they are independent copies and editing one changes nothing else.
The dates in my output grew a time and a Z that I never wrote.
YAML has a real timestamp type, so 2026-01-01 is parsed as a date rather than a string, and JSON has no date type at all — the only way to write one is as text, and the standard text form is the full ISO string with a time and a zone. So 2026-01-01 becomes "2026-01-01T00:00:00.000Z". The number of values this happened to is counted on screen. If you want the original characters back, quote the value in the YAML source so it is read as a string in the first place.
It says one of my keys is not a string, but it looks fine to me.
YAML lets a key be any value: 1, true, null, 2026-01-01 and even a whole sequence are all legal keys. JSON keys can only be strings, so the parser calls String() on yours and moves on. Usually that is harmless — 1 becomes "1". A date key is not harmless: String() on a date produces a sentence built from your browser's own time zone and locale, so the same file converted on a colleague's laptop produces a different key. Every non-string key is listed with the string it turns into so you can quote the ones that matter.
Can I convert the JSON back and get my original YAML file?
No, and nothing can. The comments are gone the moment the file is parsed, because the parser does not record where they were. So are the blank lines, your choice of quotes, your block scalar styles, and the names you gave your anchors. Converting back gives you a valid YAML file that means the same thing and reads differently. If what you want is a tidy version of the same file rather than a round trip, use the YAML Formatter, which at least keeps anchors as anchors instead of expanding them.
Is my file uploaded to a server?
No. Transmute processes everything locally in your browser using JavaScript and WebAssembly. Your files never leave your device — there is no server, no upload, no cloud processing.