YAML to JSON

Convert YAML to JSON in your browser.

Free, no limit Nothing uploaded Works offline No sign-up

Built for configuration files, which is what YAML is for

This converter handles the YAML people actually write: nested maps, block sequences, scalars, quoted strings, inline lists and comments. That covers Docker Compose files, CI pipelines, Kubernetes manifests and application config, which between them are almost every YAML document in existence.

It does not implement the whole specification, and it is worth saying so. YAML has anchors, aliases, custom tags, multi document streams and several block scalar styles. Those are rare outside generated files, and a converter that quietly mishandled them would be worse than one that says up front where the line is.

Values are typed the way YAML intends: unquoted numbers become numbers, true, false, yes and no become booleans, and a tilde or an empty value becomes null.

A YAML configuration file being converted into JSON

How to use it

Paste into the left box and the result appears in the right one as you type. Change any option and it recalculates immediately.

Copy puts the result on your clipboard and confirms it did. Download saves it as a file, which is the easier route when the output is long enough that selecting it by hand is a nuisance. Clear empties the boxes and puts the cursor back where you need it.

Where a sample button appears, it loads a small realistic example. It is there so you can see what the tool expects before pasting your own material, which is quicker than reading a description of the input format.

Keyboard and mobile

The text areas are ordinary form fields, so every shortcut your system already has works: select all, undo, redo, and paste without formatting. Tab moves between the panes and the controls in the order you would expect, and every control is reachable without a mouse.

On a phone the panes stack rather than sitting side by side, and the text areas grow to a comfortable height. Spellcheck and autocorrect are switched off in them, because a tool that silently capitalises your yaml to json input is worse than useless.

If something looks wrong

When the result is not what you expected, the message under the boxes is the first thing to read. It reports what happened rather than a generic failure, so a malformed input names the line to look at and a successful run reports what it did, such as how many lines it kept or how many replacements it made.

A count of zero is informative in itself. It usually means the input did not contain what you thought it did, most often because of capitalisation or an invisible trailing space, both of which are far more common in pasted data than people expect.

Nothing is corrected silently. If the input cannot be handled, the output is left empty and the reason is stated, rather than a partial result being returned that looks plausible and is wrong. A tool that guesses is worse than one that says it could not.

Where YAML surprises people

The format is friendly to read and has several sharp edges that only show up in production.

  • Indentation must be spaces. Tabs are not permitted anywhere in YAML, and a tab pasted from an editor will break the document.
  • Unquoted yes and no are booleans. A country code of NO becomes false. Norway has caused a great many bugs this way.
  • A version like 1.10 is a number and becomes 1.1. Quote version strings, always.
  • Leading zeros vanish unless the value is quoted, which matters for identifiers and phone numbers.
  • Colons inside unquoted strings break the parse, since a colon is what separates a key from a value.

Every one of those is fixed by quoting the value, which is why experienced YAML authors quote far more than looks necessary.

How the four data formats compare

JSON, XML, YAML and CSV describe the same kinds of information and disagree about almost everything else. Which one a system wants is usually a decision somebody made a decade ago, which is why converting between them is such a common job.

FormatBest atCommentsTypesHuman editing
JSONAPIs and interchangeNoYesFair
XMLDocuments and enterprise systemsYesNoPoor
YAMLConfiguration filesYesYesGood
CSVTabular data and spreadsheetsNoNoGood

JSON won interchange because it maps directly onto the data structures every language already has, and because it is unambiguous. Its weakness is that it has no comments, which makes it a poor choice for anything a person maintains by hand.

XML is more capable than any of them, with attributes, namespaces and schema validation, and pays for that in verbosity. It survives wherever a system was built before JSON existed and in industries where schema validation is a requirement rather than a preference.

YAML exists because configuration files are read and edited by people. It has comments, less punctuation and readable nesting, at the cost of significant whitespace and some genuinely surprising type coercion.

CSV is not really a format at all, more a family of conventions, but every spreadsheet on Earth opens it. It holds a flat table and nothing else, which is why converting nested data into it always involves a decision about what to do with the nesting.

Safe to use with real data

Most online developer tools post whatever you paste to a server. For a toy example that is fine. For the payload you are actually debugging, which is a production API response with customer records in it, an internal configuration file or a token, it is a data disclosure that nobody signed off.

Everything on this page runs in your browser. The parsing, the conversion and the formatting all happen in memory on your own machine. Nothing is transmitted, nothing is logged, and there is no server that could keep a copy even if someone asked it to.

You can check that yourself: open your browser's network panel, paste something in and watch nothing happen. Then disconnect from the internet and use the yaml to json tool anyway, because once the page has loaded it does not need the network again.

That constraint also shapes what we will build. Anything that genuinely requires a server, such as looking up a value in a database, is not something we can offer honestly under these terms, so we do not offer it at all.

No limits, and no account

There is no cap on how much text you can run through this, no daily quota and no sign up wall at the point where it becomes useful. The YAML to JSON tool costs us nothing to provide because it runs on your device rather than ours, so there is nothing to meter.

There is also nothing to install. It is one page of HTML, one stylesheet and one script, which together come to a fraction of the weight of a single photograph. It loads in well under a second on a phone connection and works immediately.

Why we built it this way

Developer tools that upload your input are a poor bargain. You get a conversion and they get your data, and the thing you pasted was usually the one piece of text you should have been most careful with. Running it locally removes the trade entirely.

The whole site is built on the same rule: if the work can be done in the browser, it is done in the browser. Over a hundred tools work that way, and the handful that genuinely cannot are the ones we have not built.

It also means the tool keeps working when we are not paying attention to it. There is no service to go down, no API key to expire and no rate limit to hit at the moment you need it most. The page you loaded is the whole program, and it will behave the same way in five years as it does today.

FAQ

YAML to JSON

The questions people ask most about this tool.

Nested maps, block sequences, inline lists and maps, comments, quoted strings and standard scalar types. That covers Docker Compose, CI pipelines, Kubernetes and application config.

Anchors and aliases, custom tags, multi document streams and block scalar folding. These are rare in hand written config and we would rather say so than mishandle them silently.

YAML treats yes, no, true and false as booleans when unquoted. Wrap the value in quotes to keep it as text. This famously affects the country code for Norway.

No, the YAML specification forbids tabs. Use spaces. A tab pasted in from an editor is a common cause of a file that will not parse.

Completely, with no account, no quota and no paid tier. It runs on your own device, so there is nothing for us to meter and nothing to charge for.

No. Everything happens inside this page, in memory on your machine. Nothing is transmitted, stored or logged, and you can confirm it by watching your browser's network panel while you type.

Yes. Once the page has loaded it never needs the network again, so you can disconnect and carry on working.

None that we impose. The practical limit is your device's memory, which on a modern machine is a very large amount of text.

Yes. The panes stack on a narrow screen and the controls stay reachable. Autocorrect is switched off in the input, so nothing is silently changed as you type.

Yes, freely and with no attribution required. What you paste is yours and so is what comes out.

Need a different conversion?

Over a hundred free tools, all running in your browser. Nothing is uploaded and nothing is capped.