YAML to JSON Converter

Paste Kubernetes, GitHub Actions, docker-compose YAML — get equivalent JSON.

convert² THE BEAUTIFIER
Enter format · K copy
INDENT
Input · raw
0 B 0 ln
1
Output · formatted
0 B 0 ln
{ }
awaiting input
paste code on the left
pick a format above
Original · A
0 B
Removed raw
Added
Original · B
0 B
↓ About this tool

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

  1. Paste your YAML into the left pane.
  2. The JSON equivalent appears on the right, indented.
  3. Nested maps, lists, and scalar types (string, number, boolean, null) are all recognised.
  4. If the YAML has an issue the parser can't handle, the output pane shows the error.

Example

Input
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
  labels:
    app: convert2
data:
  log_level: info
  features:
    - beautify
    - diff
  retries: 3
Output
{
  "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, null stays null.
  • 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.yaml files from different Helm releases.
  • Extracting values with jq after 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.

Other tools

copied