TOOLS · YAML / JSON
Convert YAML to JSON, or JSON to YAML.
Paste a Docker Compose file, a GitHub Actions workflow, a Kubernetes manifest, or any config, and convert it either direction instantly. Nothing you paste here leaves your device.
Why Convert Between YAML and JSON?
YAML and JSON represent the exact same kind of data, nested objects, arrays, strings, numbers, booleans, just written differently. YAML uses indentation and is easier for a human to read and hand-edit, which is why most config files (Docker Compose, GitHub Actions, Kubernetes, CI pipelines) are written in it. JSON is stricter and far more universal for APIs and most programming languages' native parsers.
Converting between them matters when a tool only accepts one format, when you want to paste a config into something that validates JSON, or when YAML's whitespace-sensitive syntax is making a bug hard to spot and seeing it as explicit JSON brackets makes the structure clearer.
How This Tool Works
Paste YAML or JSON into the box and convert it either direction. Everything runs in your browser using the same open-source YAML parser (js-yaml) many Node.js tools use internally, nothing you paste here is sent to a server.
Common Uses
- Converting a Docker Compose file to JSON to validate it or feed it into a tool that expects JSON.
- Turning a GitHub Actions workflow into JSON to see its exact structure when YAML's indentation is ambiguous.
- Converting JSON config or API output into YAML for a tool or file that expects it instead.
Frequently Asked Questions
Does this support multi-document YAML files (separated by ---)?
No, this converts a single YAML document at a time. A file with multiple documents separated by --- needs each document converted separately.
Will converting YAML to JSON and back produce the exact same file?
The data will be identical, but YAML-specific formatting (comments, blank lines, anchors and aliases, your original key ordering style) isn't preserved through a round trip, since JSON has no equivalent for any of that.
Why does my Docker Compose or GitHub Actions file fail to convert?
Usually inconsistent indentation (YAML is whitespace-sensitive, mixing tabs and spaces breaks it) or a value that needs quotes but doesn't have them, like a version number such as 3.8 that YAML tries to interpret as something other than a plain string. The error message will point at roughly where parsing failed.