CanDoYa
EN

JSON to YAML Converter

Runs entirely in your browser - no upload, no sign-up.

JSON
YAML
Paste JSON to convert it to YAML.
Share this tool

How do you convert JSON to YAML?

Paste your JSON into the converter and it re-serialises the same data as block-style YAML: objects become key-value mappings, arrays become dash lists, and nested structures are indented for you. Choose 2 or 4 space indentation, and it runs entirely in your browser so nothing is uploaded.

How to use

  1. 1Paste your JSON. Paste or type JSON into the left panel, or load the example to see the format.
  2. 2Pick the indentation. Choose 2 or 4 space indent. Invalid JSON is flagged in the status bar with the exact parse error.
  3. 3Copy the YAML. The YAML updates live on the right. Copy it or download it as a .yaml file.

Who it's for

JSON and YAML describe the same data model (objects, arrays, strings, numbers, booleans and null), so converting between them is a lossless re-serialisation, not a translation. This tool parses your JSON and re-emits it as clean block-style YAML: braces and brackets give way to indentation, quotes disappear from keys and plain strings, and readability goes up. It is handy when a config file, CI pipeline or Kubernetes manifest wants YAML but your data started life as JSON.

Everything happens locally in your browser using JavaScript. Your data is never uploaded, logged or sent to a server, so it is safe to convert API responses, secrets or config that contain private values.

FAQ

Is JSON to YAML conversion lossless?

Yes. JSON and YAML share the same data types, so every object, array, string, number, boolean and null maps directly across. The tool also quotes strings that YAML might otherwise misread, so parsing the YAML back gives you the original values.

Can I choose the indentation?

Yes. Pick 2 or 4 spaces from the Indent selector. YAML uses spaces, never tabs, so both options produce valid, portable output that any parser accepts.

What happens with nested objects and arrays?

They are indented as block-style YAML. Nested objects go one level deeper, arrays become dash lists, and an array of objects gets the compact '- key: value' form. Empty objects and arrays render as {} and [].

What if my JSON is invalid?

The status bar turns red and shows the exact parse error, including the position, so you can find the stray comma or missing quote. The output stays empty until the JSON is valid.

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser using JavaScript. Nothing you paste is sent to a server, stored or logged, so it is safe for private or sensitive data.