YAML ↔ JSON Converter
Convert YAML to JSON and back, with clear parse errors.
Updated: June 26, 2026
Convert between YAML and JSON
YAML and JSON describe the same kinds of data — objects, arrays, strings, numbers, booleans — but in different syntaxes. This tool converts in either direction right in your browser: turn a JSON API payload into readable YAML, or turn a Kubernetes/CI YAML file into JSON for a tool that expects it. Parsing happens locally, so your config never leaves the page.
When you'll need this
- Pasting a JSON snippet into a Kubernetes manifest or GitHub Actions workflow that uses YAML.
- Feeding a YAML config into an API or library that only accepts JSON.
- Quickly reading a dense JSON object as indented YAML, or vice versa.
- Spotting a structural bug by viewing the same data in the other format.
YAML's strengths — and its traps
YAML is friendlier to write: no braces, comments are allowed, and indentation
shows structure. But that indentation is significant, and mixing tabs with
spaces (YAML forbids tabs for indentation) is a classic source of errors. The
infamous "Norway problem" is another: unquoted no, yes,
on and off can be interpreted as booleans, and an
unquoted country code NO may become false. When in
doubt, quote your strings. This converter surfaces parse errors so these issues
don't slip through silently.
What's preserved (and what isn't)
Standard scalars, mappings and sequences round-trip cleanly. Note that JSON has
no comments, so converting YAML → JSON drops any # comments. YAML
anchors and aliases are expanded on conversion. Key order is generally preserved,
which keeps diffs readable.
Pair it with these
After converting to JSON, tidy it up with the JSON formatter. Scheduling a job from your config? Decode the schedule with the cron explainer.
Frequently asked questions
Is YAML a superset of JSON?
Effectively yes — any valid JSON is also valid YAML (for YAML 1.2). That's why JSON converts to YAML cleanly, and most YAML converts to JSON as long as it uses standard scalars, maps and lists.
Why did my YAML fail to parse?
The usual culprits are inconsistent indentation, a tab used for indentation (YAML requires spaces), or a colon inside an unquoted string. The error message points you to the problem.
Does converting YAML to JSON keep my comments?
No. JSON has no concept of comments, so any # comments in the YAML are dropped when converting to JSON.
Is my data uploaded?
No. Conversion runs entirely in your browser, so Kubernetes secrets, CI config and other sensitive YAML stay on your machine.
Config & infrastructure tooling
Teams managing lots of YAML config often adopt:
- Infrastructure-as-code platform Validate and lint YAML/JSON manifests in CI so broken config never reaches production.
- Secrets manager Keep credentials out of YAML config files and inject them securely at runtime instead.
Learn more
Related tools
- JSON Formatter & ValidatorBeautify, minify and validate JSON with clear error messages.
- Cron Expression ExplainerDecode any cron schedule into plain English and preview the next run times.
- Regex TesterTest regular expressions against text and inspect every match and group.
- .htaccess & nginx Redirect GeneratorTurn a list of old → new URLs into Apache .htaccess and nginx redirect rules.