elefcode

JSON tool

JSON to YAML — free online tool

Convert any JSON document to YAML 1.2 in your browser — proper quoting, nested objects and arrays, multi-line strings.

What does this do?

YAML is a human-friendly serialization format used by Kubernetes manifests, Docker Compose, GitHub Actions, Ansible, and many config files. It supports the same data shape as JSON but with cleaner syntax. This converter uses js-yaml, the library behind most JavaScript YAML tooling, so reserved words, numbers-as-text and multi-line strings are quoted or block-formatted exactly as YAML parsers expect. Combine it with a JSONPath query to convert just part of a document.

When to use it

  • ▸Convert API responses into Kubernetes / Docker Compose configs
  • ▸Translate `package.json` snippets to a CI workflow
  • ▸Reformat JSON test fixtures as readable YAML
  • ▸Migrate config files from JSON to YAML

Tip

Empty objects/arrays render as `{}` / `[]`. Strings that YAML would read as something else — `"true"`, `"null"`, `"2026-01-15"`, `"#fff"` — are quoted, and multi-line strings use the `|` block style so line breaks are preserved. For YAML → JSON, multi-document files and indentation options, use the YAML ⇄ JSON tool.

Example: API response → YAML config

Input — JSON

{
  "name": "elefcode",
  "version": "1.0.0",
  "ports": [80, 443],
  "env": {
    "NODE_ENV": "production",
    "LOG_LEVEL": "info"
  },
  "tags": ["web", "api", "edge"]
}

Output

name: elefcode
version: 1.0.0
ports:
  - 80
  - 443
env:
  NODE_ENV: production
  LOG_LEVEL: info
tags:
  - web
  - api
  - edge

More JSON tools