Skip to main content
File & Data Conversion Tools

YAML to JSON Converter

Convert YAML to JSON using a real YAML parser - handles nested mappings, sequences, and scalar types correctly.

Paste YAML below - this tool parses it with a real YAML parser and outputs clean, formatted JSON.

For the reverse direction, see the JSON to YAML Converter.

How to Use It

  1. Paste valid YAML.
  2. Click Convert.
  3. Copy or download the resulting JSON.

Understanding the Result

YAML mappings become JSON objects, sequences become arrays, and scalar types (strings, numbers, booleans, null) are preserved according to YAML's own type inference rules.

Common Errors

YAML is indentation-sensitive - a common source of parse errors is mixing tabs and spaces, or inconsistent indentation between sibling keys. This tool reports the parser's error message to help pinpoint the issue.

Example

# service settings
server:
  host: example.com
  ports: [80, 443]
  tls: true
users:
  - name: asha
    admin: true
  - name: ravi

becomes:

{
  "server": {
    "host": "example.com",
    "ports": [
      80,
      443
    ],
    "tls": true
  },
  "users": [
    {
      "name": "asha",
      "admin": true
    },
    {
      "name": "ravi"
    }
  ]
}

The comment is dropped, because JSON has no comments.

Why Convert YAML to JSON?

  • Checking how a Kubernetes, Compose or CI file is really structured when indentation is confusing.
  • Sending YAML-authored data to an API or tool that only accepts JSON.
  • Comparing two configs as JSON, or querying them with jq.

Fixing Common YAML Errors

  • Tabs: YAML indentation must use spaces.
  • Missing space after a colon: key:value is a single string; write key: value.
  • Special characters: quote values that start with @, *, &, { or contain : .
  • Uneven indentation: sibling keys must line up exactly.

Convert back with JSON to YAML. For Kubernetes manifests, also try the Kubernetes Manifest Validator.

Frequently Asked Questions

The most common causes are tabs used for indentation, inconsistent indentation, and a missing space after a colon.

No. JSON has no comments, so they are dropped.

The YAML parser follows the YAML 1.2 core schema, where only true/false are booleans. Quote values in your YAML if you want them treated as text.
Share this tool: