Skip to main content
File & Data Conversion Tools

JSON to YAML Converter

Convert JSON to clean, properly-indented YAML using a real YAML serializer.

Paste JSON below - this tool parses it and serializes it as clean, properly-indented YAML.

For the reverse direction, see the YAML to JSON Converter.

How to Use It

  1. Paste valid JSON.
  2. Click Convert.
  3. Copy or download the resulting YAML.

Understanding the Result

JSON objects become YAML mappings, arrays become YAML sequences, and primitive types (strings, numbers, booleans, null) are preserved - the output uses standard block-style YAML formatting for readability.

Limitations

YAML supports some features JSON has no equivalent for (anchors/aliases, comments) - since the input is JSON, the output is always plain, comment-free YAML.

Example

{"name":"invoice-kit","port":8080,"debug":false,"version":"1.10","features":["pdf","csv"],"database":{"host":"db.internal","port":5432}}

becomes:

name: invoice-kit
port: 8080
debug: false
version: '1.10'
features:
  - pdf
  - csv
database:
  host: db.internal
  port: 5432

Notice '1.10' is quoted: without quotes, YAML would read it as the number 1.1. The serializer adds quotes wherever a string could be misread as another type.

Why Convert JSON to YAML?

  • Kubernetes manifests, Docker Compose files, GitHub Actions and GitLab CI all use YAML.
  • OpenAPI specs are usually easier to review in YAML.
  • Readability: no braces or quotes around every key, and you can add comments afterwards.

Tips

  • Validate the JSON first - a single trailing comma stops the conversion. Use the JSON Validator.
  • YAML uses spaces for indentation, never tabs; keep that in mind when you edit the result.
  • Add comments with # after converting to document important settings.

Convert back with YAML to JSON. For Kubernetes files, tidy the result with the Kubernetes Manifest Formatter. Read JSON vs YAML vs TOML vs XML for when to use each.

Frequently Asked Questions

YAML is easier to read and edit by hand, and it is the standard format for tools like Kubernetes, Docker Compose, GitHub Actions and Ansible.

Yes. A real YAML serializer is used, so values such as "yes", "on" or "1.0" are quoted when needed and keep their original type.

Yes, JSON is technically valid YAML 1.2, but converting it gives the cleaner, indentation-based style people usually expect.
Share this tool: