Home / Developer Tools / YAML to JSON Converter
Free online tool

YAML to JSON Converter

Convert YAML or YML to formatted JSON in your browser, without uploading data. Open a UTF-8 file, locate errors, then copy or download JSON.

Start using

When to convert YAML to JSON

Convert a configuration fragment or an OpenAPI data structure for a program that accepts JSON. Review the resulting values before using them. Conversion checks syntax and supported data types; it does not validate a Kubernetes, Compose or application schema.

A working YAML → JSON example

# YAML to JSON Converter
service: "Demo service"
enabled: true
threshold: 12.5
release: 2026-10-26
account: "00123"
tags: ["configuration", "API"]
defaults: &defaults
  retries: 3
job: *defaults
{
  "service": "Demo service",
  "enabled": true,
  "threshold": 12.5,
  "release": "2026-10-26",
  "account": "00123",
  "tags": [
    "configuration",
    "API"
  ],
  "defaults": {
    "retries": 3
  },
  "job": {
    "retries": 3
  }
}

Strings, numbers, booleans, null, lists and objects are supported. YAML 1.2 keeps yes, no, on, off and dates as strings; true and false become booleans. Quote identifiers such as "00123" to preserve leading zeros. Comments and anchors are not retained in JSON.

Text and number conventions

Keep UTF-8 names and accented text in string values. YAML and JSON numbers use a decimal point: 12.5. A locale-formatted value such as "12,5" must stay a quoted string; the converter does not reinterpret local number formats.

Fix a conversion error

  • Check indentation, colons and closing quotes at the indicated position.
  • Each object key must be unique; rename or remove the duplicate.
  • Indent with spaces, not tabs.
  • JSON object keys must be strings; quote numeric and boolean keys.
  • Quote integers outside the safe range. Infinity and NaN cannot be JSON numbers.
  • Merge keys (<<) are unsupported. Write the fields explicitly.
  • Convert one YAML document at a time; do not silently discard later documents.
  • Reduce nesting or alias expansion. Cyclic references cannot become JSON.

Are .yml and .yaml different?

Both extensions identify YAML. Open either as UTF-8 text; the output is a .json file. Only YAML → JSON is supported here, not the reverse direction.

Supported limits

One YAML 1.2 document; 262,144 UTF-16 code units of input; 512 KiB per file; 64 nesting levels; 50,000 expanded values; 2,097,152 output code units; 5 seconds including worker startup. Alias expansion uses a safety factor of 50, not a promise to accept exactly 50 references. Decimal values use JavaScript floating-point precision.

Conversion runs locally in a browser worker. Your YAML is not uploaded, added to a URL or saved in browser storage. Downloaded files and clipboard contents remain under your control.

Continue with your JSON

YAML 1.2.2 · yaml 2.9.1

Processing takes place locally in your browser.