Developer tools · free · no signup

JSON to YAML & YAML to JSON

Convert JSON to YAML or YAML to JSON with indentation controls, Kubernetes presets, and zero server upload. Your work stays on this device whenever possible.

Free to useNo accountClear results
Preparing tool…
Simple, transparent workflow

How to use JSON to YAML & YAML to JSON

  1. Choose the conversion direction at the top of the workspace; the left input label updates automatically.
  2. Paste your document into the left editor, or click one of the four "DevOps & Cloud Presets" buttons (Kubernetes Deployment, Docker Compose v3, GitHub Actions CI, OpenAPI 3.0 Spec) to load a realistic configuration structure.
  3. Pick "2 spaces" or "4 spaces" in "Indentation", then choose a "Quote Style": Auto / Minimal, Single Quotes or Double Quotes.
  4. Tick "Sort keys alphabetically" to order mapping keys at every level; when converting back to braces, a "Minify output" checkbox also appears.
  5. Press "Convert", inspect the right-hand panel, then use "Copy Result" or "Download File" to save the converted configuration.

Worked example

Paste {"name":"web","ports":[80,443],"debug":false} with 2-space indentation selected. The output panel renders "name: web", then "ports:" with the two port numbers on indented dash lines ("- 80" and "- 443"), followed by "debug: false". Ticking "Sort keys alphabetically" and converting again places "debug" first, followed by "name" and "ports".

When to use this tool

  • Turning an API payload into a clean Kubernetes or Docker Compose manifest ready to commit to a repository.
  • Checking that a hand-edited GitHub Actions workflow has valid indentation and syntax before pushing.
  • Sorting keys alphabetically across two configuration files so a side-by-side diff shows only real value changes.

Important limitations

Converts standard JSON data types into compliant YAML 1.2 syntax. Cyclic object graphs or undefined JavaScript property values are not representable in standard JSON.

Comparing alternatives

Other options for json to yaml & yaml to json include json2yaml.com, ConvertSimple, CodeBeautify, OnlineYAMLTools.

ToolkitPoint is not affiliated with those services.

Frequently asked questions

Why does reverse conversion fail when I am offline?

The full parser library (js-yaml) is loaded from a public script host when you press Convert. If that request is blocked, the page falls back to a tiny built-in routine that only accepts input starting with a brace or bracket, so indentation-based files need an active connection on first load.

What happens to inline comments and anchors?

Comments are dropped because brace-based data structures cannot store them, and anchors and aliases (& and *) are expanded into repeated values in the output tree. A multi-document stream separated by three dashes (---) is rejected because the parser reads one document per run.

Does sorting keys work on nested objects?

When generating indented mappings, alphabetical sorting applies recursively at every depth. In the reverse direction it orders the top-level object keys first, so always inspect deeply nested structures before committing them.

What do the Quote Style options change?

Auto lets the serialiser quote only when a string requires disambiguation, such as a value that looks like a number, boolean or colon-separated mapping. Single and Double wrap every string scalar in quotes while leaving numbers, booleans and nulls unquoted.

Why did my number or date change shape?

Indentation-based parsers interpret unquoted scalars according to schema rules, so bare tokens like yes, no or scientific notation (1e3) may be typed differently unless quoted. Values stay logically equal across a round trip.