Paste JSON, get clean YAML. Built for Kubernetes manifests, Compose files, and CI workflows. 100% in your browser.

Input - JSON
Output - YAML
Ctrl+Shift+CCopyCtrl+KClear

Share this tool

Found it useful? Help a fellow developer discover it.

https://developertoolkit.dev/tools/json-to-yaml

Convert in the other direction

Going the other way, turning a YAML manifest into JSON for an API call?

Convert YAML to JSON

Open YAML to JSON Converter

Why convert JSON to YAML?

Almost every tool in the modern deployment stack reads YAML, while almost every API speaks JSON. That mismatch is where this converter earns its place. You pull a resource definition out of the Kubernetes API as JSON and need it as a checked-in manifest. You generate a config object in a script and need it as a values.yaml for a Helm chart. You export a workflow definition and need it back under .github/workflows. Converting by hand means counting indentation levels and hoping you did not turn a string into a boolean. This tool does it in one paste, and because the conversion runs entirely on your device, you can safely paste a manifest that still contains secrets.

Where the YAML output goes

Kubernetes and Helm

  • ·Resource manifests pulled from kubectl get -o json
  • ·Helm values.yaml files generated from a config object
  • ·CRD definitions converted for version control
  • ·Kustomize overlays assembled programmatically

CI and local dev

  • ·GitHub Actions workflow files under .github/workflows
  • ·GitLab CI, CircleCI, and Azure Pipelines definitions
  • ·docker-compose.yml services generated from a template
  • ·Ansible playbooks and inventory files

How to convert JSON to YAML

  1. Paste your JSON. Drop it into the left panel. The page already opens in the JSON to YAML direction, so there is nothing to switch.
  2. Read the YAML instantly. Output appears on the right as you type. Invalid JSON is flagged inline with the position of the parse failure.
  3. Copy or download. Copy to the clipboard, or download the result as a .yaml file ready to commit.
  4. Use Swap to round-trip. Swap feeds the YAML back in as input and flips the direction, which is a fast way to confirm the conversion is lossless.

Frequently Asked Questions

How do I convert JSON to YAML online?

Paste your JSON into the left panel. This page opens already set to the JSON to YAML direction, so the YAML output appears on the right immediately. Copy it to your clipboard or download it as a .yaml file. Everything runs in your browser, so nothing is uploaded.

Is JSON to YAML conversion lossless?

Yes. YAML is a superset of JSON, so every JSON type maps cleanly onto a YAML equivalent: objects become mappings, arrays become sequences, and strings, numbers, booleans and null carry over exactly. Nothing is dropped going in this direction. The loss only happens in reverse, because YAML comments and anchors have no JSON equivalent.

Will the YAML output be valid for Kubernetes?

The syntax will be valid YAML that any Kubernetes parser accepts. Whether the resource itself is valid depends on your JSON containing the fields Kubernetes requires, such as apiVersion, kind and metadata. The converter does not add or validate schema fields, it faithfully represents whatever structure you paste.

Why are some of my strings quoted in the YAML output?

YAML quotes a string when leaving it bare would change its meaning. Values such as yes, no, on, off, true, null, and anything that looks like a number or a date would be parsed as a non-string type if left unquoted. Quoting them preserves the exact value from your JSON. This is correct behavior, not noise.

Can I control the indentation of the YAML output?

Yes. Use the indent selector in the tool to switch between 2-space and 4-space output. Two spaces is the convention for Kubernetes manifests, Docker Compose and GitHub Actions, so it is the default.

How do I convert YAML back to JSON?

Use the Swap button to flip the direction in place with the current output as the new input, or open the YAML to JSON converter, which is a separate page written around that direction with its own guidance on parsing and API payloads.

Does deeply nested JSON convert correctly?

Yes. Nesting depth is not limited and structure is preserved exactly. Very deep structures produce heavily indented YAML, which is a readability tradeoff of the format itself rather than a conversion problem. If the result is hard to read, that is usually a signal the config wants splitting into multiple files.

Is it safe to paste a config that contains secrets?

Yes. The conversion runs entirely in your browser using client-side JavaScript. Your JSON is never sent to a server, never logged, and never leaves your device. That is the reason this tool exists in the form it does.

Related Tools