The Util Box

JSON to YAML Converter

Free online json to yaml converter for developers. Convert JSON to YAML format. Fast and private.

YAML Output
Paste JSON above

Embed this tool

Copy and paste the code below into your website to embed this tool for free. An attribution link to The Util Box is required.

<iframe src="https://www.theutilbox.org/embed/json-to-yaml" width="600" height="500" frameborder="0" style="border: none; max-width: 100%;" title="Free JSON to YAML Converter tool from The Util Box"></iframe>
<!-- Free tool by The Util Box — https://www.theutilbox.org/tools/json-to-yaml -->
<a href="https://www.theutilbox.org/tools/json-to-yaml">JSON to YAML Converter by The Util Box</a>

Frequently Asked Questions about JSON to YAML Converter

JSON to YAML Converter — Clean, Indented YAML from Any JSON

This JSON to YAML converter takes any JSON document and rewrites it as YAML. Paste your JSON into the top box and the YAML appears below it immediately, indented two spaces per level and written in block style: nested objects sit on their own lines, arrays become dash-prefixed items, and empty objects and arrays collapse to {} and [].

The output is not a text substitution. Your JSON is parsed first, so the converter doubles as a validator — if the input is not strictly valid JSON, the parser's own error message appears in the output panel with a red border rather than a half-converted document.

How Each JSON Type Is Translated

JSON input YAML output
{"name":"Util Box"} name: Util Box
{"port":8080} port: 8080
{"admin":true} admin: true
{"value":null} value: null
{"tags":["a","b"]} tags:
  - a
  - b
{"meta":{"id":7}} meta:
  id: 7
{"a":{},"b":[]} a: {}
b: []

Strings are quoted only when YAML needs it. A value is wrapped in double quotes when it contains any of : { } [ ] , & * ? | < = ! % @ ` #, when it starts with a digit, a dot or a hyphen, or when it contains a double space. Everything else is written bare, which is why the word Util Box stays unquoted above while a value like a: b would be quoted.

Limits Worth Knowing Before You Paste the Result Into a Pipeline

The converter is deliberately small, and a few of its boundaries are worth stating plainly rather than discovering later:

  • Bare words are not quoted. A JSON string whose value is true, false, null, yes or no is emitted unquoted, so a YAML 1.1 parser — PyYAML among others — will read it back as a boolean or as null rather than as the string you started with. Quote those values by hand before committing a config file.
  • Keys are never quoted. Only values are checked. A key containing a colon or a leading character YAML treats specially will need quoting added manually.
  • No document marker or block scalars. The output has no --- header, no | or > multi-line strings, no anchors or aliases, and no explicit type tags.
  • The round trip reorders integer-like keys. Your JSON is parsed into a JavaScript object before it is written out, and JavaScript stores numeric-looking keys ("1", "2", "10") ahead of string keys regardless of the order you wrote them.

Every one of those boundaries is visible in the output panel, so you can catch the awkward cases by reading the result before you paste it.

Related Converters

  • YAML Formatter — tidy YAML you already have, in either direction of the same problem.
  • YAML to JSON — the reverse conversion, when a YAML file needs to become an API payload.
  • YAML Lint — check a YAML file for syntax errors and duplicate keys.
  • YAML Path Query — pull a single value out of a YAML document by path.
  • YAML Minifier — strip the whitespace back out for a size-sensitive file.
  • JSON Formatter — pretty-print the JSON before converting it, if it arrived minified.
  • JSON to XML — the same source format, converted for a different target.

The conversion runs entirely in your browser. Your JSON is never uploaded, so it stays usable for configuration files and API payloads that contain credentials or internal endpoints.