# JSON to YAML Converter

> Convert JSON to clean YAML and decode YAML back to JSON. Round-trips common JSON shapes.

URL: https://uttir.com/json-to-yaml
Categories: data-tools, developer-tools
Privacy: Conversion runs locally in your browser. No data is uploaded.

## About

YAML is a human-friendly data format that you will encounter in Kubernetes manifests, GitHub Actions workflows, Ansible playbooks, Docker Compose files, and most modern configuration. This tool converts JSON to YAML and back, so you can paste JSON from an API response and get a YAML config ready to drop into a repo.

Both directions preserve the data: objects map to mappings, arrays to sequences, and the common scalar types round-trip cleanly. Multi-line strings, anchors, and flow style are not supported — keep your input to the everyday JSON subset.

## How to use

1. **Choose direction** — Toggle between JSON → YAML and YAML → JSON.
2. **Paste your input** — The output updates as you type or paste.
3. **Copy the result** — One click to copy the converted text.

## Examples

### Service manifest

A common Kubernetes-style service definition.

Output:

```
apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  ports:
    - port: 80
      targetPort: 8080
```

### Decoded back to JSON

Round-trip is lossless for plain JSON.

Output:

```
{"apiVersion":"v1","kind":"Service",...}
```

## FAQ

### Does this support flow style and anchors?

Not yet. This tool targets the most common block-style YAML subset. It round-trips plain JSON shapes perfectly. If you need full YAML 1.2 support, look for a tool built on PyYAML or libyaml.

### Why does my YAML output look indented differently than I expected?

Indentation is 2 spaces per level. If your editor expects 4, just run the result through your formatter of choice — the data is unchanged.

### When should I use YAML instead of JSON?

YAML is easier to read and edit by hand. JSON is easier for machines to parse and is the lingua franca of web APIs. Use YAML for configuration files, CI/CD pipelines, and any place humans will edit the data. Use JSON for everything else.

## Related tools

- [JSON Formatter](https://uttir.com/json-formatter) — Format, beautify, and validate JSON with adjustable indentation — instantly in your browser.
- [CSV to JSON Converter](https://uttir.com/csv-json-converter) — Convert CSV to JSON and JSON to CSV instantly, right in your browser.
- [SQL Formatter](https://uttir.com/sql-formatter) — Format and beautify SQL queries for MySQL, PostgreSQL, SQLite, and more — with optional keyword uppercase and tab indentation.

---

For the full HTML page with the live tool, visit https://uttir.com/json-to-yaml.
This file is the markdown rendering at https://uttir.com/json-to-yaml.md. See https://uttir.com/llms.txt for a site-wide summary.
