YAML to JSON Converter: and JSON to YAML

Use this yaml to json converter to switch config files between formats. Paste YAML to get clean JSON, or paste JSON to get YAML. It flags errors with line numbers, so it's handy for Kubernetes, CI files and app settings.

YAML ⇄ JSON Converter

Validate and convert configs.

Everything runs in your browser. Nothing you enter or upload is sent to a server.

How to use the YAML ⇄ JSON Converter

  1. Paste YAML or JSON.
  2. Press YAML → JSON or JSON → YAML.
  3. Fix any error shown with its line number.
  4. Copy or download the result.

How it works

The converter uses js-yaml, a widely used YAML 1.2 parser. YAML is parsed into data and written as formatted JSON, or JSON is parsed and written as block-style YAML. Several YAML documents separated by --- become a JSON array.

Example

"server:\n port: 8080" becomes {"server": {"port": 8080}} in JSON.

Frequently asked questions

Is JSON valid YAML?

Yes, YAML 1.2 is a superset of JSON.

Are comments kept?

No. JSON has no comments, so YAML comments are dropped.

Is my config uploaded?

No. Everything runs in your browser.

See also: JSON Formatter & Validator, CSV to JSON Converter.

Convert YAML and JSON

How to use it

  1. Paste YAML or JSON.
  2. Pick the direction.
  3. Fix any errors shown.
  4. Copy or download.

More questions

Are comments kept?

JSON has no comments, so they are dropped.

Does it check errors?

Yes. It checks for errors and shows the line numbers where they are.

Is my data uploaded?

No. Everything stays in your browser on your device.

Related tools: JSON Formatter & Validator, CSV to JSON Converter (and JSON to CSV), XML Formatter and Validator.