YAML to JSON (Free Online Tool)

Parse YAML into JSON for diff, validation, and config-normalization pipelines

Paste your JSON → Get results instantly (no signup)

⚡ Instant resultsNo signupRuns in your browser
Try examples:

Parse a k8s Deployment YAML into JSON for downstream diff or validation.

apiVersion: apps/v1
kind: Deployment
metadata:
name: web-server
namespace: prod
spec:
replicas: 3
template:
spec:
containers:
- name: nginx
image: nginx:1.25
ports:
- containerPort: 80
 
Output
1{
2 "apiVersion": "apps/v1",
3 "kind": "Deployment",
4 "metadata": {
5 "name": "web-server",
6 "namespace": "prod"
7 },
8 "spec": {
9 "replicas": 3,
10 "template": {
11 "spec": {
12 "containers": [
13 {
14 "name": "nginx",
15 "image": "nginx:1.25",
16 "ports": [
17 {
18 "containerPort": 80
19 }
20 ]
21 }
22 ]
23 }
24 }
25 }
26}

Love the result?

Use this exact pipeline in your app, backend, or LLM workflow.

No setup needed. Works with curl, Node, Python.

Uses example data. For edited input, copy from the playground.

Read integration guide

Works with:

  • API responses
  • Nested JSON
  • Arrays & objects

Example: input → output

Related tools

Advanced usage (optional)

YAML to JSON

v1.0.0
Convert
string

Description

YAML to JSON

Parse YAML text into JSON. Designed as an ingress adapter for the ForgeJSON pipeline — once YAML is JSON, every downstream utility (pick fields, validate schema, clean, diff) operates on it natively.

How It Works

Paste a YAML document, get back the parsed JSON tree. js-yaml's safe loader rejects unsafe tags (!!js/function etc.) and preserves YAML's natural key order.

Configuration

FieldTypeDefaultDescription
Multi-document StreambooleanfalseParse a YAML stream (----separated documents) into an array. Useful for Kubernetes manifest bundles

Use Cases

  • Kubernetes manifests — parse a Deployment, Service, or ConfigMap YAML into JSON for diff or schema validation
  • GitHub Actions workflows — convert .github/workflows/*.yml into JSON for analysis
  • docker-compose — flatten compose files for service-level transformations
  • Application config — normalize YAML configs into JSON for environment-aware merging

Common Pipeline Patterns

YAML string
  → convert.yaml-to-json
  → structure.pick-fields    (extract canonical k8s shape)
  → cleanup.clean-json       (normalize for diff-stable output)
  → validation.schema        (assert deployment contract)

Configuration

NameTypeDefaultDescription
Multi-document StreambooleanfalseParse a YAML stream (documents separated by `---`) into an array. Useful for Kubernetes manifest bundles.

Examples

AI Prompt
Parse a k8s Deployment YAML into JSON for downstream diff or validation.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-server
namespace: prod
spec:
replicas: 3
template:
spec:
containers:
- name: nginx
image: nginx:1.25
ports:
- containerPort: 80
 
Output
1{
2 "apiVersion": "apps/v1",
3 "kind": "Deployment",
4 "metadata": {
5 "name": "web-server",
6 "namespace": "prod"
7 },
8 "spec": {
9 "replicas": 3,
10 "template": {
11 "spec": {
12 "containers": [
13 {
14 "name": "nginx",
15 "image": "nginx:1.25",
16 "ports": [
17 {
18 "containerPort": 80
19 }
20 ]
21 }
22 ]
23 }
24 }
25 }
26}
Config
Multi-document Stream
OFF

API Usage

POST /api/v1/utilities/convert.yaml-to-json
Example:
curl -X POST https://your-domain.com/api/v1/utilities/convert.yaml-to-json \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inputs":{"primary":"apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: web-server\n  namespace: prod\nspec:\n  replicas: 3\n  template:\n    spec:\n      containers:\n        - name: nginx\n          image: nginx:1.25\n          ports:\n            - containerPort: 80\n"},"config":{"multiDocument":false}}'
Response
1{
2 "apiVersion": "apps/v1",
3 "kind": "Deployment",
4 "metadata": {
5 "name": "web-server",
6 "namespace": "prod"
7 },
8 "spec": {
9 "replicas": 3,
10 "template": {
11 "spec": {
12 "containers": [
13 {
14 "name": "nginx",
15 "image": "nginx:1.25",
16 "ports": [
17 {
18 "containerPort": 80
19 }
20 ]
21 }
22 ]
23 }
24 }
25 }
26}