YAML ⇄ JSON

Convert between YAML and JSON.

About the YAML ⇄ JSON

Converts YAML to JSON and JSON back to YAML in the same panel, which is what you need when a Kubernetes manifest, a GitHub Actions workflow, or a Compose file has to be read by something that only speaks JSON. Pick the indent width first. Syntax errors come back with a line and column rather than a generic failure, and both directions run entirely in your browser.

How to use the YAML ⇄ JSON

  1. Paste YAML or JSON into the input panel, or press Sample to load an example.
  2. Set Indent to 2 or 4 spaces.
  3. Press YAML → JSON, or JSON → YAML for the reverse.
  4. Press Copy, or Download to save the result as a file.

Frequently asked questions

Do comments survive the conversion?
No. JSON has no comment syntax, so YAML comments are dropped when the document is parsed, and converting back does not bring them home. Keep the commented original in version control.
Is `no` converted to false?
No, it stays the string "no". The parser follows the YAML 1.2 core schema, where only true and false are booleans — yes, no, on, and off are plain strings. Older YAML 1.1 parsers do read them as booleans, which is where the surprise usually comes from.
Why does a file with several documents fail?
The converter parses a single document, so a stream separated by --- is rejected with “expected a single document in the stream”. Split it and convert each document on its own.
What happens to anchors and aliases?
Going to JSON, they are resolved and written out in full. Coming back from JSON, the output never emits anchors, so a value repeated in three places is printed three times rather than shared with &ref and *ref.
Is my file uploaded?
No. Parsing and serialising happen in the page, which matters because manifests routinely carry internal hostnames, secret names, and account IDs.

Related tools