YAML to JSON Converter

Convert YAML config files to JSON

How to convert YAML to JSON

  1. Paste your YAML: a Kubernetes manifest, Docker Compose file, GitHub Actions workflow, Ansible playbook, OpenAPI spec or any other document.
  2. The JSON appears as you type. If several documents are separated by ---, they become a JSON array.
  3. If there is a syntax error, the exact line and column are shown, which makes indentation mistakes quick to find.
  4. Copy the JSON or download it as a file.

Why convert YAML to JSON?

YAML is pleasant for people to write, but many tools, APIs and programming languages work more easily with JSON. Converting lets you feed a config file to jq, validate it against a JSON Schema, send it to an API that only accepts JSON, or simply see exactly how YAML interpreted your file. That last point matters: YAML guesses types, so an unquoted 08, 1.10 or yes may not mean what you think. The JSON output shows the real values.

Anchors and aliases are expanded, comments are removed (JSON has no comments) and the YAML 1.2 rules are used, so yes and no stay strings. The converter uses the js-yaml library, and your data is processed locally in your browser.

FAQ

Why does YAML say "bad indentation"?

YAML nesting is based on spaces. Check that items at the same level line up exactly and that no tabs are used for indentation.

How are multiple YAML documents handled?

Documents separated by --- are converted into a JSON array, one element per document, as with kubectl multi-resource files.

Can I convert the JSON back to YAML?

Yes. Press Swap to send the result back through the JSON to YAML direction.

Made by BufferMint. We also design and build software products for founders. See our services →

Your files and inputs never leave your device; we only count anonymous visits.