JSON to YAML

Processed locally
app.yaml.view

You can also load data via #data={"name":"Ada"} or #url=... It is cleared from the address bar after it is read.

JSON fits APIs; YAML is more common for Kubernetes, CI, and local config. This page converts both ways in the browser so you do not upload a full manifest to an online converter. Switch direction: JSON → YAML for reading and editing, YAML → JSON for programmatic consumption.

Two-way

Paste JSON on the left to get YAML, or paste YAML to get JSON. After converting, spot-check indent and types (for example, YAML on / off may be treated as a boolean).

Advanced YAML features such as complex anchors and multi-documents have limited support today.

For configuration

Edit Deployment, docker-compose, and similar files, then convert back to JSON to validate. Use JSON for API mocks and YAML for deploy manifests, with this page in between.

After converting, smoke-test in the target environment to confirm behavior matches a hand-written file.

Comments

YAML comments cannot be kept when converting to JSON—that is a format limit. Put important notes in repo docs.

Converting from JSON to YAML will not invent comments either.

Example

JSON
{
  "apiVersion": "apps/v1",
  "kind": "Deployment",
  "metadata": { "name": "json-toolbox" }
}
YAML
apiVersion: apps/v1
kind: Deployment
metadata:
  name: json-toolbox
What if indentation is wrong?

YAML is indent-sensitive. If parse fails, check spaces first. Converting to JSON and then formatting often makes structure easier to see.

How do I choose versus JSON5?

If you want comments while staying close to JSON syntax, use JSON5. For K8s / Ansible, use YAML.

Do I need to click “Convert”?

Yes. Unlike the formatter, this page does not process on every keystroke. Convert again after you change direction or content.

Will key order change?

It may not match hand-written YAML exactly, but semantics stay the same. Check order-sensitive pipelines yourself.

Recommended workflow

  1. Pick a direction: JSON → YAML or YAML → JSON.
  2. Paste the source, click “Convert”, and download if needed.
  3. Check indent on the YAML side; validate the JSON side on the validator page.
  4. Run once in K8s / CI to confirm behavior matches the pre-conversion file.

Keep a backup of the original. Handle anchors, merge keys, and other complex YAML with a dedicated tool or by hand.