YAML / JSON Converter Developer Tool

Convert between YAML and JSON in either direction.

Config files, CI pipelines, and Kubernetes manifests are usually written in YAML, while APIs and application code overwhelmingly speak JSON, so translating between the two by hand is a recurring chore. This free converter is a developer tool that converts YAML to JSON and JSON to YAML in either direction, entirely in your browser.

YAML

JSON

Runs entirely in your browser — no data is sent anywhere.

A common-case YAML subset, not the full spec

The YAML specification is large, and a fully conformant parser has to handle anchors and aliases (&anchor / *alias), multiple documents in one stream, flow-style collections ({a: 1, b: 2} and [1, 2, 3]), and several string-quoting styles with subtly different escaping rules. This tool's hand-written parser covers the block-style YAML that makes up the overwhelming majority of real config files instead: nested maps and lists via indentation, plain/single/double-quoted strings, numbers, booleans, and null. If your YAML uses anchors, flow-style collections, or multi-document streams, expect this tool to fall short — it's built for typical docker-compose.yml, GitHub Actions workflow, or application-config shaped documents, not the full spec.

Why JSON can't always losslessly round-trip through YAML

Every JSON document is valid data that YAML can represent, since YAML is a superset of JSON's data model — but going YAML to JSON and back to YAML won't reproduce the original formatting: comments are discarded (JSON has no equivalent and this parser doesn't preserve them), and any YAML-specific style choices like multi-line block scalars (| or >) collapse down to a single JSON string, which this tool then re-serializes back to a plain quoted YAML string rather than reconstructing the block scalar syntax.

Where each format tends to show up

YAML dominates configuration: Kubernetes manifests, GitHub Actions and GitLab CI pipelines, Ansible playbooks, and Docker Compose files all use it, largely because it's easier for a human to hand-edit than JSON — no trailing-comma errors, no mandatory quoting of keys, and comments are actually possible. JSON dominates everywhere data crosses a wire: API request and response bodies, most datastores' native format, and anywhere a strict, unambiguous grammar matters more than human-editability. Converting a hand-maintained YAML config into JSON to feed an API, or the reverse when adapting a JSON API response into a config file, is the usual reason to reach for this tool.

Related tools

Once you have JSON, the JSON viewer is the better place to explore or pretty-print a large or deeply nested structure, and the CSV / JSON converter covers the other common structured-data pairing when the destination is a flat spreadsheet rather than YAML.