YAML to JSONONLINE

Convert YAML mappings and sequences into strict JSON in your browser.

1 MiB per input · Ctrl / ⌘ + Enter to run

YAML 1.2 core values only. Mapping keys must be strings; non-finite numbers and cyclic aliases are rejected.

Result
Ready. Paste input, then run the tool.
Your JSON stays in your browser. Core processing happens locally.
THE PRACTICAL GUIDE

Convert YAML configuration into strict JSON data

YAML to JSON converts mappings, sequences, and supported YAML 1.2 scalar values into strict JSON. It helps move configuration examples into systems that accept only JSON.

When should you use it?

  • Convert a YAML settings example to JSON.
  • Inspect YAML data with the JSON viewer.
  • Share a configuration value with a JSON-only API.
WORKED EXAMPLE

Example: YAML mapping becomes an object

The mapping becomes a JSON object and the YAML boolean becomes a JSON boolean.

YAML input
name: Alex
active: true
JSON output
{"name":"Alex","active":true}

Check which YAML values JSON can represent

JSON supports objects with string keys, arrays, strings, finite numbers, booleans, and null. YAML can express more, including complex mapping keys and cyclic aliases. Those structures cannot be transferred directly to JSON, so unsupported values fail instead of being silently rewritten. Comments and presentation choices also disappear because JSON has no equivalent for them.

Review numeric values after conversion

This direction uses JavaScript number semantics for decimal values. Precision-sensitive identifiers are safer as quoted strings in the YAML source. After conversion, inspect the fields that look numeric and test the result with the receiving schema. If the YAML configuration uses format-specific tags or behavior, consult the configuration system before assuming that converting its data produces an equivalent configuration file.

AT THE WORKBENCH

Make configuration data strict JSON.

Parse YAML into mappings, sequences, and scalar values, then export valid JSON with clear errors for unsupported values.

  1. Paste YAML

    Load local UTF-8 text. No referenced URLs are fetched.

  2. Check the mapping

    Duplicate keys, complex keys, and unrepresentable values are reported.

  3. Export JSON

    Copy or download the resulting document.

IN PRACTICE

How do I convert a YAML configuration to strict JSON?

Paste a YAML 1.2 document and convert its mappings and sequences to JSON objects and arrays. Use quoted YAML strings when a value must remain text, then review the JSON types before handing the output to an API.

YAML mapping with a quoted identifier

yaml
name: Alex
active: true
account: "00123"

The JSON result keeps account as "00123" and active as true. Complex mapping keys and cyclic aliases cannot be represented as ordinary JSON.

No. YAML supports values JSON cannot express, including non-string mapping keys and cyclic aliases. The tool reports those cases rather than silently changing the shape.

BEFORE YOU USE THE RESULT

What should you check before using the result?

JSON cannot express cycles or non-finite numbers. Decimal parsing follows JavaScript number semantics, so check precision-sensitive values and implicit YAML types.

YAML can express more than JSON

JSON object names must be strings, and JSON cannot represent cycles or non-finite numbers. These cases produce an error rather than a guessed conversion.

Numeric values

Integer values are read as BigInt to avoid rounding during conversion. Decimal YAML values are converted to JSON numbers; check precision-sensitive data before using the output.

Compare JSON and YAML

Technical reference: YAML 1.2.2 specification

THE JSON FIELD GUIDE
All guides