YAML / JSON Converter
Convert YAML to JSON or JSON to YAML. Invalid input shows the parser's error.
YAML and JSON are both data serialization formats. Most web APIs send and receive JSON. Configuration files more often use YAML, because it is easier to read and edit by hand.
YAML is a superset of JSON, so every valid JSON document is also valid YAML. YAML adds comments, anchors, and multi-line strings. Kubernetes, Docker Compose, and most CI/CD pipelines use it for configuration.
Kubernetes config
Convert K8s YAML manifests to JSON and back
CI/CD pipelines
Convert GitHub Actions or GitLab CI configs between formats
API specs
Convert OpenAPI/Swagger specs between YAML and JSON
Docker Compose
Work with Docker Compose files in either format
What is the difference between YAML and JSON?
YAML (YAML Ain't Markup Language) and JSON (JavaScript Object Notation) are both data serialization formats. YAML marks structure with indentation, which makes it easier to read. JSON uses braces and brackets, and JavaScript parses it natively. Both can represent the same data structures.
Can YAML represent everything JSON can?
Yes. YAML is a superset of JSON, so every valid JSON document is also valid YAML. YAML also has comments, anchors, aliases, and multi-line strings, which JSON lacks.
Why would I convert YAML to JSON?
Many APIs only accept JSON. Convert YAML to JSON when you need to send configuration to one of them, load it in JavaScript, or validate its structure in code.
Why would I convert JSON to YAML?
Kubernetes manifests, Docker Compose files, and most CI/CD pipelines use YAML. Converting JSON to YAML gives you a config file you can read and edit by hand, and you can add comments to it.
Is my data safe when using this converter?
Yes. Conversion runs in your browser, and your data is never sent to a server.
Private by default
Conversion runs in your browser. Your data is never sent to a server.
Related tools
JSON Formatter
Format JSON online in your browser. Paste or upload JSON to tidy it with 2 or 4 space indents, find syntax errors, minify it or browse it as a collapsible tree.
JavaScript to JSON
Convert JavaScript object literals to valid JSON
JSON Merge
Merge two JSON objects online with a deep or shallow strategy and choose how arrays combine. Useful for config files and API responses. Free, no signup.