YAML to JSON Converter
Paste Kubernetes, GitHub Actions, docker-compose YAML — get equivalent JSON.
What it does
YAML is everywhere in devops — Kubernetes manifests, GitHub Actions workflows, docker-compose files, Helm values, CloudFormation templates, Ansible playbooks. But most programming languages, APIs and debugger tools speak JSON natively.
Converting YAML to JSON lets you plug values into jq, diff more cleanly, paste into tools that don't understand YAML, or just sanity-check the structure.
How to use it
- Paste your YAML into the left pane.
- The JSON equivalent appears on the right, indented.
- Nested maps, lists, and scalar types (string, number, boolean, null) are all recognised.
- If the YAML has an issue the parser can't handle, the output pane shows the error.
Example
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
labels:
app: convert2
data:
log_level: info
features:
- beautify
- diff
retries: 3
{
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": {
"name": "app-config",
"labels": {
"app": "convert2"
}
},
"data": {
"log_level": "info",
"features": ["beautify", "diff"],
"retries": 3
}
}
Why convert2
- Local. Your infra YAML often carries secrets (API keys, connection strings) — keep them in your browser.
- Preserves types. Numbers stay numbers, booleans stay booleans,
nullstaysnull. - Nested structures. Maps-of-lists-of-maps all round-trip correctly.
- Pairs with the diff viewer. Convert two YAML files to JSON, then diff them — easier to spot structural changes.
Common use cases
- Reading a Kubernetes manifest's structure when you're more fluent in JSON.
- Feeding YAML config into a tool that only accepts JSON.
- Sanity-checking a GitHub Actions workflow before pushing.
- Comparing two
values.yamlfiles from different Helm releases. - Extracting values with
jqafter conversion.
YAML → JSON specifics
- Supports the common subset: scalars (string, int, float, bool, null), sequences (
- item) and mappings (key: value). Nested freely. - Anchors (
&anchor) and aliases (*alias) have partial support — simple cases work. - Multi-document streams (
---separators) aren't split; only the first document is parsed. - Comments (
#) are stripped — JSON has no comments. - For full YAML 1.2 compliance in mission-critical cases, use a local parser. convert2 handles the common devops cases well.
Frequently asked questions
What YAML features are supported?
Scalars, nested maps, lists, basic types (string, number, boolean, null). Anchors and complex tags have partial support.
Can I convert JSON back to YAML?
Not yet — but the diff mode can compare the two formats directly after auto-format.
Does it handle multi-document YAML?
Only the first document in a stream separated by --- is parsed.
What about comments?
Comments are dropped because JSON doesn't support them.