YAML to JSON Converter
Paste YAML config and get clean JSON output. Supports nested objects, arrays, comments, and all YAML scalar types.
Frequently Asked Questions
What types of YAML does this converter support?
The converter handles the most common YAML patterns: key-value pairs, nested objects (indentation-based), arrays (- item), quoted strings, booleans (true/false/yes/no), integers, floats, and null values. Comments (# ...) are automatically stripped.
Can I convert Kubernetes or Docker Compose YAML files?
Yes. The tool handles typical DevOps YAML files including Kubernetes manifests, Docker Compose, GitHub Actions workflows, and Ansible playbooks.
Is the output valid JSON?
Yes. The output uses JSON.stringify() which always produces spec-compliant JSON. You can choose 2-space, 4-space, or minified indentation.
My YAML has anchors (&) and aliases (*). Are they supported?
Anchors and aliases are advanced YAML features not supported by this tool. For complex YAML with anchors, consider using a Node.js script with the js-yaml library.
Is my data uploaded to a server?
No. Parsing happens entirely in your browser using JavaScript. Your data is never sent anywhere.
YAML Quirks to Watch for When Converting
- Implicit types — YAML auto-converts bare values:
yes/no/on/offbecome booleans;1.0becomes a float. Quote them to keep them as strings. - Comments are dropped — JSON has no comment syntax, so
# commentsare silently removed during conversion. - Anchors & aliases — YAML anchors (
&anchor) and aliases (*alias) are resolved by YAML parsers before outputting to JSON, which may result in duplicate data. - Multiline strings — block scalars (
|and>) become regular JSON strings with embedded\ncharacters.
When You Need JSON from a YAML Source
- REST API payloads — APIs expect
application/json; convert your YAML test fixture to JSON before sending with cURL or Postman. - Package manifests —
package.json,tsconfig.json, and AWS CloudFormation templates require JSON. - Browser
localStorage/IndexedDB— browser storage APIs only handle JSON-serialisable data.