CoreJSON

YAML to JSON

This YAML to JSON converter turns YAML config into standard JSON instantly, handling anchor merging, flow syntax and multi-line strings. It parses under the YAML 1.2 core schema, avoiding implicit-type traps such as yes/no and dates. Computation runs locally in your browser and nothing is uploaded.

Open in the workbench Runs locally · nothing is uploaded

How to use it

  1. 1

    Paste your YAML

    Paste YAML text into the input; both block style and flow style ([] and {}) are supported.

  2. 2

    Validate and convert automatically

    Conversion happens after you pause typing; indentation and quoting problems are located to a specific line and column with a clear message.

  3. 3

    Choose JSON indentation and copy

    Select 2 or 4 space indentation and copy the standard JSON, or click the ⇄ button to convert in reverse.

  4. 4

    Reuse the output

    Paste the JSON into an API payload, a config file or another tool on this site.

Key features

YAML 1.2 core schema

Only JSON-compatible scalars are used: yes/no are not treated as booleans, dates stay strings, and results are predictable.

Anchors and merge keys

& anchors, * references and << merge keys are supported and expanded to the final structure on conversion.

Duplicate key detection

Aligned with the JSON rule of unique keys, duplicate keys raise an error instead of being silently overwritten.

Line and column error location

Indentation errors, tab indentation and unclosed quotes are all located by line and column.

Streaming and block syntax

Block sequences and mappings, flow [] and {}, quoted and plain scalars are all accepted.

Local and private

Parsing happens in your browser and the data is not uploaded.

Common errors & troubleshooting

  • ! YAML is extremely sensitive to indentation: items at the same level must align, and only spaces may be used, never tabs.
  • ! In YAML 1.2, yes, no, on and off are plain strings; write true / false when you need a boolean.
  • ! A document containing only comments or whitespace has no data to convert — keep at least one key-value pair or scalar.
  • ! Multi-document YAML separated by --- must be handled in batches, since JSON has a single root.

Frequently asked questions

Why was my date not converted to a special type?

This is deliberate: JSON has only strings and no date type, so under the YAML 1.2 core schema dates stay strings (such as "2026-01-01"), avoiding inconsistent Date objects when a downstream language deserialises them.

What should I do if a duplicate key is reported?

The same key appears twice at one level. JSON objects do not allow duplicate keys, so remove or rename one and retry; the tool errors out rather than silently letting the later value win.

Which YAML syntaxes are supported?

Block sequences and mappings, flow [] and {}, anchor references, << merges, single and double quotes and plain scalars. Multi-document YAML (separated by ---) needs batch handling.

Is my YAML uploaded?

No. Parsing happens locally in your browser, so configuration files and secrets can be pasted safely.

Related tools