YAML to JSON Converter

Convert YAML to JSON or JSON to YAML instantly, with clear error messages that point to the line that’s wrong. Everything runs in your browser.

Load an example
Download

🔒 This tool runs entirely in your browser. Nothing you enter or upload is sent to our servers.

How to use the YAML to JSON Converter

  1. Choose YAML → JSON or JSON → YAML.
  2. Paste your YAML or JSON, or drop a .yaml, .yml or .json file onto the box. The converted output appears as you type.
  3. If the input has a mistake, the error message gives the line and column so you can fix it.
  4. Choose the indent, then copy the result or download it as a file.

About this tool

YAML and JSON describe the same kind of data — maps, lists, strings, numbers, booleans and null — so one converts cleanly into the other. YAML is the format people write: Kubernetes manifests, Docker Compose files, GitHub Actions workflows, OpenAPI specs and countless app configs. JSON is the format programs exchange: APIs, package.json, test fixtures and most libraries’ config loaders. Converting lets you feed a YAML config to a tool that only reads JSON, or turn a JSON API response into something readable.

The converter uses js-yaml, the widely used open-source YAML parser, following the YAML 1.2 core schema. That means yes, no, on and off stay strings rather than turning into booleans (the YAML 1.1 behaviour behind the well-known “Norway problem”), anchors and aliases (&base, *base, <<: *base) are expanded into the data they refer to, and a file holding several documents separated by --- becomes a JSON array with one entry per document.

Converting to JSON drops YAML comments, because JSON has no comments. Going the other way, keys keep their order, long strings are not folded, and strings that would be misread as numbers or booleans are quoted. Your data never leaves the browser, so it is safe to paste configs that contain internal hostnames or credentials — though it’s still good practice to remove secrets first.

Frequently asked questions

How do I convert YAML to JSON?

Paste the YAML into the box with YAML → JSON selected. The JSON appears below as you type; copy it or download it as a .json file.

Why does my YAML give an error?

The most common causes are mixing tabs and spaces (YAML only allows spaces for indentation), a list item or key indented by a different amount than its siblings, and a colon inside an unquoted value. The error shows the line and column where the parser gave up — the real mistake is usually on that line or just above it.

What happens to comments?

They are dropped when converting to JSON, because JSON has no comment syntax. Converting JSON to YAML cannot produce comments either, since there are none in the source.

Are yes and no converted to true and false?

No. This converter follows YAML 1.2, where only true and false (in any capitalisation) are booleans. yes, no, on and off stay strings. Older YAML 1.1 parsers treat them as booleans, which is why a country code like NO can turn into false.

Does it support multiple YAML documents?

Yes. Tick “Multiple documents” and a file with several documents separated by — becomes a JSON array with one entry per document.

Is my data uploaded?

No. Parsing and conversion happen in your browser, and nothing is sent to a server or saved.