Toolvist

YAML to JSON Converter

Convert YAML to JSON online — paste your YAML and get valid JSON you can copy or download. Free converter that handles nested maps and lists.

Free Online YAML to JSON Converter

The YAML to JSON converter translates YAML into JSON for use in APIs and JavaScript. It supports the common YAML subset: nested mappings, sequences, and scalars (strings, numbers, booleans, null).

The reverse is the JSON to YAML Converter, and the configuration's syntax is worth confirming with the YAML Validator. If the data is destined for a table rather than a config file, the YAML to CSV Converter is the next step.

How to use the YAML to JSON

  1. 1 Paste your YAML or load a file.
  2. 2 Convert. Indentation is significant in YAML, so a mis-indented block is reported rather than guessed.
  3. 3 Check the resulting structure against what you expected.
  4. 4 Copy the JSON, or format it first for readability.

Why both formats persist

YAML is designed to be written by people: comments are supported, quoting is rarely needed, and indentation replaces punctuation. That makes it pleasant for configuration a human maintains. Its cost is that it is fragile — a subtle indentation error changes meaning or breaks parsing entirely.

JSON is designed to be read by machines: unambiguous, no comments, no whitespace significance beyond token separation. It is safe to generate and safe to parse, which is why APIs speak it. Converting between them means moving from a format optimised for authorship to one optimised for transmission.

  • Tabs are forbidden for indentation in YAML.
  • Comments are dropped — JSON has no syntax for them.
  • Anchors and aliases are expanded into duplicated values.
  • Dates and timestamps become strings.

Supported Subset

Advanced YAML features (anchors, multi-line block scalars, complex flows) are not supported. For those, use a full parser like js-yaml in your build pipeline.

Frequently asked questions

Why did my YAML fail to parse when it looked fine?

Because YAML is whitespace-sensitive, and a tab where a space was expected is a hard error. Tabs are not permitted for indentation in YAML at all. Mixed indentation, or a value that contains an unquoted colon, are the other common causes — a colon inside a plain string has to be quoted or the parser reads it as a key.

How does YAML handle types that JSON does not have?

By supporting more of them. YAML has dates, timestamps, anchors and aliases for reuse, and multiple documents in one stream. Converting to JSON forces a decision: dates become strings, anchors are expanded, and only one document can be represented. The information is not lost so much as narrowed to what JSON can express.

Is JSON a strict subset of YAML?

Effectively yes for practical purposes, which surprises people. Most JSON documents are valid YAML, since YAML's flow style mirrors JSON's braces and brackets. The reverse is not true, because YAML allows constructs JSON has no representation for.

Related Developer Tools

Browse all Developer Tools →

You might also need

Tools from other categories that people pair with the YAML to JSON:

Browse the full tool directory →