Skip to content

Convert YAML to JSON

Convert a YAML document to JSON using a safe schema, with no arbitrary YAML types or constructors allowed.

Processed on your device. Nothing is sent to any server.

Parses the YAML with a schema restricted to JSON's basic types (objects, arrays, strings, numbers, booleans and null), avoiding the execution of custom YAML constructors for security.

Use cases

  • Converting a YAML config file (like docker-compose or CI/CD) to JSON.
  • Debugging a complex YAML's structure.
  • Migrating configuration from YAML to JSON.

How it works

  1. 1

    Paste your YAML

    Type or paste the YAML document into the input box.

  2. 2

    Convert it

    Click Convert and copy or download the resulting JSON.

Technical details

  • It uses YAML's JSON schema: "yes", "no", "on" or "off" stay as text (not true or false), and dates such as 2024-01-05 remain strings.
  • Anchors and aliases (&name, *name) are resolved and comments are dropped, since JSON has no comments.
  • Custom tags (such as !!js/function) are rejected with an error instead of being executed.

Frequently asked questions

Why use a restricted schema?

YAML allows defining custom types that could execute code in less careful parsers; the JSON_SCHEMA is limited to JSON's safe data types.

← Data