JSON to YAML Converter

Convert any JSON object or array to clean, readable YAML with configurable indent size, optional flow-style output, document separator markers, forced string quoting, and alphabetical key sorting. A pivot mode lets you transpose tabular arrays so each column becomes a top-level YAML sequence, and an auto-upgrade option flattens single-value arrays into scalar fields. Everything converts instantly in the browser — paste, upload a file, or load from a URL with no data sent to a server.

Input

JSON

Format

Advanced

Indent Size

3 rows, 4 columns
Output

YAML

What is JSON to YAML Converter?

Kubernetes, GitHub Actions, Docker Compose, Ansible — the infrastructure tooling ecosystem has standardised on YAML, but programmatic config generation almost always produces JSON. Pasting a JSON config into a JSON to YAML search is the kind of task developers do dozens of times a week. This converter handles every edge case that trips up naive converters: strings that look like YAML booleans (true, yes, on) are automatically quoted to prevent type coercion; and deeply nested structures produce correctly indented YAML regardless of how complex the input is. Choose 2-space or 4-space indentation to match your project conventions. The output is ready to drop directly into a .yml config file, a Helm values file, or a GitHub Actions workflow definition.

How to Use

  1. 1

    Paste Your JSON

    Paste your JSON object or array into the input editor, or drag-and-drop a .json file. Minified and pretty-printed JSON are both accepted without any pre-processing.

  2. 2

    Set YAML Style Options

    Choose 2-space or 4-space indentation to match your project conventions. Toggle block vs flow style for arrays, and optionally force-quote all string values for strict YAML parsers.

  3. 3

    Convert to YAML

    Click "Convert to YAML". The tool parses your JSON and emits valid YAML, correctly quoting strings that look like reserved YAML scalars (true, null, 1.0) to prevent type ambiguity.

  4. 4

    Copy into Your Config File

    Copy the YAML output directly into your .yml config file, Kubernetes manifest, GitHub Actions workflow, or Docker Compose file — or download it as a .yml file.

Common Use Cases

Kubernetes Manifest Creation

Convert JSON resource definitions into YAML to create Kubernetes deployment, service, and ConfigMap manifests. kubectl and Helm both prefer YAML as their primary configuration format.

GitHub Actions Workflow Config

Translate JSON workflow configurations or job definitions into YAML for use in .github/workflows/ files. GitHub Actions exclusively uses YAML for pipeline definitions.

Docker Compose Files

Convert JSON service definitions into docker-compose.yml format. Docker Compose requires YAML and converting from JSON lets you programmatically generate service configs from structured data.

Application Config Migration

Migrate application configuration from JSON (config.json) to YAML (config.yml) when adopting frameworks like Spring Boot, Rails, or NestJS that default to YAML for their config files.

Conversion Examples

JSON Config → YAML Config

A flat JSON config object becomes a clean, readable YAML file.

Input JSON

{
  "server": {
    "host": "localhost",
    "port": 8080,
    "debug": true
  },
  "database": {
    "url": "postgres://localhost/mydb",
    "pool": 5
  }
}

Output CSV

server:
  host: localhost
  port: 8080
  debug: true
database:
  url: postgres://localhost/mydb
  pool: 5

JSON Array → YAML Sequence

JSON arrays become YAML block sequences with dash notation.

Input JSON

{
  "allowed_hosts": ["localhost", "api.example.com", "*.example.com"],
  "features": [{"name": "auth", "enabled": true}, {"name": "payments", "enabled": false}]
}

Output CSV

allowed_hosts:
  - localhost
  - api.example.com
  - '*.example.com'
features:
  - name: auth
    enabled: true
  - name: payments
    enabled: false

Frequently Asked Questions