yaml to json icon — free online yaml to json

YAML to JSON Converter — Free Online

Paste your YAML config on the left, get clean, formatted JSON on the right. Our free YAML to JSON converter is perfect for Kubernetes manifests, CI pipelines, and API payloads — with zero uploads.

🔄 YAML → JSON

How the yaml to json works

YAML (human-friendly, indentation-based) and JSON (machine-friendly, brace-based) represent the same data structures: mappings (key–value objects), sequences (lists), and scalars (strings, numbers, booleans, null). Every valid JSON document is technically valid YAML — but not vice versa.

This converter parses common YAML — nested mappings, lists, and typed scalars — entirely in your browser with JavaScript. Your data never leaves your device, which matters when configs contain secrets or internal hostnames.

Common conversion scenarios:

  • Kubernetes & Docker Compose manifests → JSON for API submission or kubectl tooling.
  • CI pipelines (GitHub Actions, GitLab CI) → JSON for programmatic processing.
  • Docker Compose & OpenAPI/Swagger files → JSON for validators and tooling that expect strict JSON.
  • API payloads: author in readable YAML, deploy strict JSON.

YAML also supports comments (# like this) — JSON does not, so comments are dropped during conversion. Prefer scripting it? The standard tools are yq -o=json, Python's yaml.safe_load + json.dumps, or Node's js-yaml.

Limitation: this handles everyday config YAML. Advanced features — anchors and aliases, multi-line literal blocks, custom tags — may need a full parser library like js-yaml or PyYAML.

How to use the yaml to json

  1. Paste your YAML into the left-hand input box.
  2. Click Convert to parse it instantly.
  3. Copy the formatted JSON from the right-hand output box.
  4. If you see an error, check indentation — YAML needs consistent spaces, never tabs.

Conversion example

YAML in, JSON out:

service: api
replicas: 3
ports:
  - 8080
  - 9090
becomes {"service": "api", "replicas": 3, "ports": [8080, 9090]}.

YAML quick-reference

YAMLMeans
key: valueMapping (object property)
- itemSequence (array item)
key: (indented block below)Nested mapping
true / 42 / nullTyped scalars (not strings)

Working with identifiers in configs? Generate them with our bulk UUID generator.

Sources & further reading

Frequently asked questions

Is my data uploaded anywhere?
No. Conversion runs 100% in your browser with JavaScript. Nothing is sent to any server.
Why convert YAML to JSON?
Many APIs and tools accept only JSON. Converting lets you author in readable YAML and deploy strict JSON.
How do I convert a YAML file to JSON?
Open the file, copy its contents, paste into the YAML input box above, and click Convert. For automation, use a CLI like Python's yaml + json libraries.
Does it handle nested YAML?
Yes — nested mappings and lists are supported. Very advanced YAML features may not parse.
Why is my YAML failing to convert?
The most common cause is inconsistent indentation — YAML requires spaces (never tabs) at consistent levels. Check for stray colons inside unquoted strings too.
What is the difference between YAML and JSON?
YAML uses indentation and is designed for human readability; JSON uses braces and brackets and is stricter. JSON is a subset of YAML, so any JSON is valid YAML.