YAML to JSON Converter
Convert YAML to JSON instantly in your browser. Validates syntax with line numbers, outputs pretty-printed JSON. Free and fully client-side.
About this tool
Turn YAML (Kubernetes manifests, CI workflows, OpenAPI specs) into strict JSON. The parser reports syntax errors with line numbers, so this doubles as a quick YAML sanity check.
Type coercion follows the YAML spec: unquoted `true`, `no`, and numeric-looking values become their typed equivalents, exactly as your deployment tooling would read them. If a value converts unexpectedly, that is YAML telling you to quote it.
Common uses
- Feed a YAML config into a tool or API that only accepts JSON.
- Debug how YAML type coercion is actually interpreting your unquoted values.
- Convert OpenAPI/Swagger YAML specs to JSON for code generators.
Automate via API
The same conversion is available as a REST endpoint for scripts, pipelines, and backends:
curl -X POST https://payloadly.com/api/v1/tools/yaml-to-json \ -H "Content-Type: text/plain" \ -H "X-Api-Key: YOUR_API_KEY" \ --data-binary @input.yaml
Worked examples
Real payloads from tools people use daily, with the exact output this converter produces. Every example runs in your browser, so you can load one and adapt it to your own data.
Convert a GitHub Actions workflow to JSON
Seeing a workflow as JSON makes it obvious how 'on', jobs, and steps actually nest, and confirms your indentation parsed the way you intended.
name: CI
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm test{
"name": "CI",
"on": {
"push": {
"branches": [
"main"
]
}
},
"jobs": {
"test": {
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v4"
},
{
"run": "npm test"
}
]
}
}
}Convert a Kubernetes manifest to JSON
The Kubernetes API is JSON under the hood; converting a manifest shows the exact structure kubectl will send.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 3
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: nginx:1.27
ports:
- containerPort: 80{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "web"
},
"spec": {
"replicas": 3,
"selector": {
"matchLabels": {
"app": "web"
}
},
"template": {
"metadata": {
"labels": {
"app": "web"
}
},
"spec": {
"containers": [
{
"name": "web",
"image": "nginx:1.27",
"ports": [
{
"containerPort": 80
}
]
}
]
}
}
}
}YAML notes
YAML is a human-friendly superset of JSON used heavily in Kubernetes manifests, GitHub Actions workflows, Docker Compose files, and CI/CD pipelines. Indentation is structural, and unquoted scalars are type-coerced.
- Indentation defines structure; tabs are not allowed for indentation.
- Unquoted values like `no`, `on`, or `1.0` may be coerced to booleans or numbers.
- Comments (`# ...`) cannot survive a round-trip through JSON.
JSON notes
JSON (JavaScript Object Notation) is the standard interchange format for web APIs, config files, and log pipelines. It is strict: keys must be double-quoted, trailing commas are invalid, and comments are not allowed.
- JSON does not support comments; they are stripped or rejected by parsers.
- Trailing commas after the last element are invalid JSON.
- Integers beyond 2^53 lose precision in JavaScript-based parsers.
Frequently asked questions
Is my data uploaded to a server?
No. This tool runs entirely in your browser using JavaScript, and there are no ads on the page. Nothing you paste or drop here is uploaded, logged, or stored, and you can verify that yourself: open your browser's developer tools and watch the Network tab while you convert (no requests leave the page), or disconnect from the internet after the page loads and keep working.
What should I watch out for when converting YAML to JSON?
Indentation defines structure; tabs are not allowed for indentation. Unquoted values like `no`, `on`, or `1.0` may be coerced to booleans or numbers. JSON does not support comments; they are stripped or rejected by parsers. Trailing commas after the last element are invalid JSON.
Is there a size limit or a fee?
The browser tool is free with no signup and comfortably handles files up to tens of megabytes (limited by your device's memory). For automated or bulk processing inside your own scripts and pipelines, use the paid REST API.
Related tools
Convert JSON to clean, readable YAML in your browser. Ideal for Kubernetes, Docker Compose, and CI config. Free, no signup, nothing uploaded.
Reformat YAML in your browser: normalize indentation to 2 spaces and consistent flow style. Validates while formatting. Free and private.
Flatten nested JSON to single-level dot-notation keys in your browser. Ideal for CSV prep, diffing, and key inventories. Free, no upload.
Format and beautify JSON in your browser with 2-space, 4-space, or tab indentation. Errors reported with line and column. Free, no upload.