Skip to content

Free YAML to JSON Converter

Paste YAML and get JSON, or switch direction to turn JSON into clean YAML. Errors point to the line that caused them.

  • 100% free
  • Runs in your browser
  • Instant results
Quick answer

A YAML to JSON converter parses YAML, the indentation-based format used for configuration files, and writes the same data as JSON. Paste YAML and the JSON appears instantly; change the direction to convert JSON to YAML. This tool supports a clearly defined, safe subset of YAML and reports the line of any error.

How to use the YAML to JSON Converter

  1. Choose the directionPick YAML to JSON or JSON to YAML.
  2. Paste your textPaste the YAML or JSON. Keep the indentation exactly as it is in the file, using spaces rather than tabs.
  3. Copy or downloadCopy the converted text or download it. If there is a problem, the message gives the line number.

Which YAML is supported

Full YAML is a large language. This YAML to JSON converter uses its own small parser and handles the parts that real configuration files use:

  • Mappings (key: value) and lists (- item), nested to any depth by indentation.
  • Scalars: plain, single-quoted and double-quoted strings (with escapes such as \n and \t), integers, decimals, hexadecimal (0x1F) and octal (0o17), true/false, and null or ~.
  • Block scalars: literal | and folded >, with the - and + chomping indicators.
  • Flow style: [a, b] and {a: 1}, including over several lines.
  • Comments, and a single leading --- document marker.

Not supported: anchors and aliases (&, *), merge keys (<<), tags (!!str), complex keys (?), multi-line quoted strings and files with several documents. These produce a clear error naming the feature, never silently wrong output.

Typing rules and JSON to YAML

Values follow the YAML 1.2 core rules. That means yes, no, on and off are strings, not booleans, which differs from older YAML 1.1 parsers. Dates and times such as 2026-01-31 or 12:30 stay strings, as JSON has no date type. Mapping keys always become strings, and duplicate keys in one mapping are reported as an error.

In the other direction, JSON to YAML writes block style with your chosen indent. Strings are quoted only when they need to be: when they are empty, could be mistaken for a number, boolean or null, or contain characters such as : , # or a line break. Converting the YAML back gives the same JSON.

Indentation is the usual source of YAML errors. Use spaces only, since tabs are not allowed for indentation, and keep items of the same level in the same column.

The conversion runs in your browser, so configuration files with secrets are not uploaded. Use the JSON formatter to re-indent the result or the JSON validator to check a JSON file first.

Frequently asked questions

How do I convert YAML to JSON?

Paste the YAML into the YAML to JSON converter with its indentation intact. The JSON appears straight away and can be copied or downloaded as a .json file.

Can it convert JSON to YAML as well?

Yes. Set the direction to JSON to YAML. Any valid JSON is supported and the output uses block style with 2 or 4 spaces.

Why do I get an error about anchors or tags?

The tool supports a safe subset of YAML. Anchors, aliases, merge keys, tags, complex keys and multi-document files are not supported, and it tells you so instead of guessing.

Why is "yes" not converted to true?

The converter follows YAML 1.2, where only true and false are booleans. Older YAML 1.1 parsers also treated yes, no, on and off as booleans. Write true or false to be safe everywhere.

Is my config file uploaded?

No. Parsing happens in your browser, so nothing you paste is sent to a server.

Last updated 24 November 2026 by the TheTechFolk team.