YAML to JSON Converter

Paste YAML such as a config file and get the same data as JSON, with a choice of layout.

Use the tool

Loading the tool…

About YAML to JSON Converter

Convert YAML into JSON. Paste the YAML, choose the JSON layout (2 spaces, 4 spaces, or one line), and copy the result.

Worked example

Paste `name: Ana`, then a list of roles and `active: true`. The output is the same data as JSON.

Limits

Some YAML features do not map cleanly to JSON, such as comments and certain types. Check the output with the system that will read it.

How to use YAML to JSON Converter

  1. Paste your YAML.
  2. Choose the JSON layout.
  3. Copy the JSON.

Good to know

  • Follows YAML 1.2: only true and false are booleans, so yes and no stay text.
  • Anchors, aliases, tags, several documents in one file and complex keys are not supported, and the error says so.
  • Dates stay as text because JSON has no date type.
  • Very large whole numbers are kept exactly as written.

Frequently asked questions

Which YAML features are supported?

Maps, lists, nested structures, plain, single-quoted and double-quoted text, multi-line text with | and >, and flow lists and maps in [ ] and { }.

Why did my YAML give an error?

The message names the line. Common causes are tabs used to indent, a repeated key, or a value with a colon and space that needs quotes.

Can it convert JSON to YAML?

Yes, use the JSON to YAML converter.