YAML to JSON converter

Simply convert YAML to JSON with this online live converter.

Enable JavaScript to use the interactive tool. The guide below explains how it works.

YAML to JSON Converter

What it does

This tool parses YAML and outputs the same data as indented JSON. Paste your YAML into the left panel and the JSON appears on the right. YAML merge keys (<<) are resolved, and invalid YAML is reported instead of producing output.

Why someone uses it

Step-by-step instructions

  1. Paste your YAML into the input.
  2. Resolve any "Provided YAML is not valid" message.
  3. Copy the JSON from the output.

Examples

Input:

name: demo
replicas: 3
enabled: true
tags:
  - web
  - api

Output: an object with "name": "demo", "replicas": 3 (a number), "enabled": true (a boolean) and a "tags" array of two strings.

Understanding the results

Mappings become objects, sequences (dash lists) become arrays, and scalars are typed automatically: 3 is a number, true is a boolean, null or ~ becomes null. Anchors and aliases (&base, *base) and merge keys are expanded so the JSON contains the full values. Comments are removed. If the document is empty, no output is shown.

FAQs

Common mistakes

Use cases

Related tools

All tools

Guides and articles