YAML to JSON Converter

Convert YAML to JSON with a safe schema: rejects custom tags and duplicate keys and limits aliases to prevent expansion attacks.

Options

Input

Up to 5 MiB. The file is not uploaded: it is read in your browser.

Ctrl + Enter to run

Result

Converts a YAML document to JSON using the YAML 1.2 core schema in safe mode. Explicit tags such as !!python/object or !custom are rejected because some languages use them to instantiate arbitrary objects; duplicate keys are an error and aliases are capped to prevent “billion laughs” expansion attacks.

Key order is preserved and large integers are written exactly in the JSON.

How to use it

  1. Paste the YAML or open a .yaml/.yml file.
  2. Pick the JSON indentation.
  3. Press Run and review the type warnings.

Example

Example input
service: api
replicas: 3
ports:
  - 8080
  - 8443
env:
  LOG_LEVEL: info
  FEATURE_X: yes
Result
{
  "service": "api",
  "replicas": 3,
  "ports": [
    8080,
    8443
  ],
  "env": {
    "LOG_LEVEL": "info",
    "FEATURE_X": "yes"
  }
}

Limitations

  • One document per conversion (no multiple blocks separated by ---).
  • Merge keys (<<), mapping or sequence keys and .inf/.nan (not representable in JSON) are not supported.
  • Decimals with more than 15–17 significant digits may be rounded.

FAQ

Why does "yes" come out as text instead of true?
Because YAML 1.2 only recognizes true and false as booleans. If your tool uses YAML 1.1 that value would be a boolean: the conversion warns you.
Is it safe to paste YAML from an unknown source?
The tool never executes tags or resolves external references and it caps aliases; still, avoid pasting secrets unnecessarily.

Related tools

References