YAML to JSON Converter

Paste a YAML config file or snippet and convert it to clean JSON, or turn JSON back into YAML, right in your browser.

Free, no sign-upRuns in your browserDeveloper and encoders

Input

Indent with spaces, not tabs. The output updates as you type.

Output


    

How to use the YAML to JSON converter

Paste YAML or JSON and pick a direction. The output updates as you type. The converter handles nested objects, lists, lists of objects, strings, numbers, booleans, null, comments, simple inline lists like [a, b] and basic multi-line strings. That covers most real-world config files. Advanced YAML features such as anchors, aliases and custom tags are not supported, so use a full YAML library for those.

Why it is useful

YAML is the standard config format for a lot of modern tooling: GitHub Actions, Kubernetes, Docker Compose, GitLab CI, Ansible and Hugo front matter. JSON is the standard format for exchanging data between systems. Moving between the two is a constant task, and this lets you do it without installing anything. Your data never leaves the browser.

Common use cases

  • Converting a docker-compose.yml to JSON for inspection
  • Reading a GitHub Actions workflow as JSON
  • Loading Kubernetes manifests into a tool that expects JSON
  • Moving Hugo or Jekyll front matter between formats
  • Checking YAML structure by converting it and looking at the nesting
  • Preparing config data for APIs that only accept JSON

YAML or JSON: when to use which

YAML is easier for people to read and edit. It allows comments, most strings need no quotes, and structure comes from indentation. JSON is stricter and parsed the same way everywhere, which makes it better for machines. Teams usually keep human-edited configs in YAML and send JSON in API payloads. For config-level data, the two hold the same information.

Frequently asked questions

Why do I get an indentation error?

YAML uses indentation to show nesting, and it must use spaces, never tabs. Every key at the same level needs exactly the same number of leading spaces. The error message points to the line that does not line up.

Can it handle YAML anchors and aliases (& and *)?

Not at the moment. Most configs do not use them outside advanced DevOps setups. For full YAML support, use a library such as js-yaml.

Are comments in JSON supported?

No. The JSON standard does not allow comments, so JSON input with comments will show an error. Variants such as JSON5 and JSONC allow them, but this tool reads standard JSON. Comments in YAML input are fine and are simply dropped.

How do lists differ between YAML and JSON?

YAML puts each item on its own line starting with "- ". JSON wraps items in square brackets, like ["item1", "item2"]. It is the same data in a different syntax, and the converter handles both.

Accessibility

Skip to Accessibility Panel