Skip to content

YAML

YAML and JSON converter

Convert between YAML and JSON, reformat and validate YAML with a safe parser.

Private Everything on these pages runs in your browser. What you type is never sent to a server and nothing is stored.

Parsed with a safe YAML loader; custom tags and code are refused.

How to use it

  1. Paste YAML or JSON into the input.
  2. Choose YAML to JSON, JSON to YAML, or Format.
  3. Copy the result, or fix the error shown with its line number.

Example

Input

name: api
ports:
  - 80
  - 443

Result

{
  "name": "api",
  "ports": [
    80,
    443
  ]
}

Frequently asked questions

Is the YAML parser safe?

Yes. It uses a parser that builds plain data only; it does not construct arbitrary objects or run code from the document.

Are comments kept when converting?

No. JSON has no comments, and reformatting YAML through data drops them. Keep the original file if the comments matter.

Related articles