ToolConvoyToolConvoyv2.6
DATA

JSON to YAML — Convert JSON to YAML Configuration

Convert JSON data to YAML configuration format. Block style, flow style, multi-document support — in your browser, no upload.

● LOCAL · ZERO-COPY PIPELINE0 network requests since page load

YAML won the configuration format war. Kubernetes, Docker Compose, GitHub Actions, Ansible, CircleCI, and almost every modern DevOps tool uses YAML as its primary configuration language. JSON lost the configuration war because it lacks comments, requires rigid quoting, and is harder to scan visually — even though YAML is technically a superset of JSON, so any valid JSON file is also valid YAML. Converting a JSON configuration, API response, or data export to YAML is the first step in migrating from a JSON-based tool to a YAML-based one, and the conversion is straightforward because the two formats share the same data model.

The one conversion decision that is not straightforward is block-vs-flow style. Block style (key:\n nested: value) is the YAML norm for configuration because it reads like an outline and diffs cleanly in version control. Flow style ({key: {nested: value}}) is JSON’s inline syntax, which is compact but unreadable for deeply nested structures. The converter defaults to block style because configuration files are the primary consumer of JSON-to-YAML conversions. The flow style toggle exists for log entries, API responses, and data exchange where compactness matters more than readability.

The most common downstream step after converting to YAML is to plug the output into a CI/CD pipeline (GitHub Actions workflow, CircleCI config), a container orchestration tool (Kubernetes manifest, Docker Compose file), or an infrastructure-as-code tool (Ansible playbook, Terraform variables file). The generated YAML is the configuration skeleton — add the environment-specific values, the secrets, and the resource limits by hand.

How to use

  1. Paste your JSON

    Drop a JSON object or paste a JSON string. The converter walks the structure and emits YAML in block style with 2-space indentation.

  2. Choose output style

    Toggle between block style (human-readable, multi-line, standard YAML) and flow style (bracket-delimited, single-line, JSON-compatible). Block style is the default for configuration files.

  3. Copy or download the YAML

    Copy the YAML to your clipboard or download as a .yml file. The output is valid YAML 1.2 and parses with PyYAML, ruamel.yaml, go-yaml, and js-yaml.

Frequently asked

Should I use block style or flow style?

Block style is the default for configuration files (Kubernetes manifests, Docker Compose, CI/CD pipelines) because it is human-readable and diff-friendly. Flow style (`{key: value, ...}`) is the default for log entries and data exchange where compactness matters and the structure is simple enough that inline syntax reads well.

How are YAML anchors and aliases generated?

The converter does not auto-detect repeated substructures to emit anchors and aliases. If a JSON object has a repeated deep structure, the YAML output repeats the structure inline. Rewrite repeated blocks as YAML anchors (`&name`) and aliases (`*name`) by hand after generation.

Does it support multi-document YAML?

Yes — toggle 'multi-document' to emit `---` separators between top-level JSON array elements. Multi-document YAML is the standard format for Kubernetes resource lists and CI/CD pipeline configurations.

How does it handle string quoting?

By default, string values are emitted unquoted when they contain no YAML-significant characters. Strings that begin with special characters (`|`, `>`, `!`, `&`, `*`, `%`, `` ` ``), look like numbers, or contain YAML control words (`true`, `false`, `null`, `yes`, `no`, `on`, `off`) are auto-quoted to prevent misinterpretation.

What about JSON numbers vs YAML numbers?

JSON numbers that are integers become YAML integers. JSON numbers with decimals become YAML floats. The value `1e10` becomes `10000000000` as a YAML integer. If the exact string representation matters (e.g. leading zeros in a product code), the value is quoted as a string.

Limitations

  • No comment preservationYAML supports `#` comments, but JSON does not. The output has no comments. Add comments by hand if your YAML configuration requires inline documentation.
  • No YAML tag directivesYAML's tag system (`!!str`, `!CustomType`) is not emitted. The output is tag-free YAML. Add tags by hand if your consumer requires them for custom deserialization.
  • Indentation is always 2 spacesThe YAML spec allows any consistent indentation, but 2 spaces is the industry convention (Kubernetes, Docker, GitHub Actions). Some tools require 4-space indentation — adjust by hand if needed.

Platform notes

macOS
The generated YAML works with any YAML-aware editor. Use the browser tool for one-off conversion of a JSON config to a YAML config for a Docker Compose or Kubernetes manifest.
Windows
The generated YAML opens in any YAML-aware editor. Use it for one-off conversion where a JSON API response needs to become a configuration file.
Linux
For command-line work, `yq eval -P` converts JSON to YAML with fine-grained control. The browser tool is the right pick for one-off conversion where `yq` is not installed.
Web
Runs entirely client-side. The conversion is instant.

Related tools