Skip to content

YAML to JSON

Convert YAML config into formatted JSON instantly.

How to use the YAML to JSON

Three steps, all in your browser.

  1. 1

    Paste your input

    Type or paste your code or data. Press Sample to try an example.

  2. 2

    Check the options

    Adjust the options if you need to. The conversion updates instantly.

  3. 3

    Copy the result

    Copy the output in one click. Nothing is saved or sent anywhere.

YAML to JSON: what to know

YAML to JSON parses YAML with js-yaml and outputs formatted JSON. It's useful when a tool or API wants JSON but your configuration is written in YAML, and as a way to see exactly how a YAML parser reads your file, which is often the fastest way to debug a confusing YAML problem.

If the YAML is invalid, the error includes the line and column. Indentation causes most problems: YAML forbids tab characters for indentation, items at the same level must be indented by the same amount, and a list item's dash needs a space after it. A value that contains ': ' or starts with characters such as *, & or ! may need quotes.

Comments are dropped, since JSON has none. Anchors and aliases (&default and *default, often used to share settings) are resolved, so each alias becomes a full copy of the value it points to. Multi-document YAML files separated by --- need to be converted one document at a time.

Popular uses

  • Debugging how a YAML config file is actually parsed
  • Feeding YAML config into a JSON-only tool or API
  • Converting OpenAPI specs from YAML to JSON
  • Checking anchors and merge keys resolve as expected

Tips for the best result

  • If a value comes out as true or false unexpectedly, quote it in the YAML.
  • Times like 12:30 and numbers with leading zeros can be read as numbers in some YAML versions; quote them to keep them as text.
  • Paste one document at a time if the file contains several separated by ---.

Read how JustYourDev works and our privacy details. Code, data and files you use here are processed in your browser and are never sent to our server.

Frequently asked questions

Usually indentation: YAML forbids tabs for indentation and items at the same level must line up exactly. A missing space after a colon, or an unquoted value that contains ': ', are other common causes.

JSON has no comments, so YAML comments are dropped. Anchors and aliases (&name and *name) are resolved, meaning the referenced value is copied into each place it's used.

No. Every tool runs in your browser, so your code, tokens, keys and files are processed on your device and are not sent to our server or stored. Reloading or closing the page clears them.

Yes. Every tool is free with no sign-up and no limits on use. Clearly labeled ads keep it that way.

Yes. The tools work in any modern browser on phones, tablets and computers, though large files and long code are easier to handle on a computer.