JSON to YAML Converter – Free, Online, Private
Turn a JSON document into YAML without uploading it. Useful when a tool only accepts YAML, such as Kubernetes manifests, GitHub Actions, or Ansible.
How to convert JSON to YAML
- Paste JSON in the input box. The sample is a small user record you can replace.
- The converter parses it with JSON.parse and prints YAML underneath.
- Copy the YAML. Nested objects become indented maps and arrays become dash lists.
What changes and what does not
YAML is a superset of JSON in the common case: the same strings, numbers, booleans, nulls, arrays and maps, written with indentation instead of braces. This converter does not invent anchors, merge keys or custom tags. It emits plain block YAML that js-yaml can read back. Key order follows the JSON text. Numbers stay numbers, so a long integer that was already imprecise in JSON stays imprecise — YAML cannot recover digits JavaScript lost. Strings are quoted when they would otherwise be misread as booleans, numbers or dates.
When to use it
Reach for this page when you copied a JSON body from an API and the next system wants a config file. A Kubernetes ConfigMap, a GitHub Actions workflow step, a docker-compose override and many Helm values files are YAML. Converting locally means tokens inside the document never leave the browser. If you need the reverse direction, use the YAML to JSON converter, which is stricter: YAML can contain comments and several documents, JSON cannot.
Worked example
The sample object has an id, a name, a boolean, a list of tags and a nested address. The YAML form drops the curly braces. tags is a sequence of two quoted or plain strings. address is a nested map under two spaces of indent. If you add a field such as "on": true, the dumper quotes the key or the value so YAML does not treat on as a boolean. Empty arrays become [] and empty objects become {}.
Limits
The parser rejects trailing commas, comments and single quotes because those are not JSON. JSONC from a tsconfig will fail until you remove comments. Extremely deep nesting is fine up to the engine's stack, but YAML readers in other languages sometimes cap depth. Duplicate keys: JSON.parse keeps the last one, and that is what gets dumped. Binary data does not belong in either format; base64-encode it first.
Frequently asked questions
Does the YAML stay equivalent to the JSON?
Yes for ordinary data. Parsing the YAML back to JSON returns the same strings, numbers, booleans, arrays and objects. Anchors and comments are not added, so nothing extra survives a round trip.
Will my document be uploaded?
No. Parsing and dumping run in your browser. The page is a static file. Nothing you paste is sent to Utilo.
Why are some strings quoted?
YAML plain scalars are ambiguous. Values such as true, null, 1.0 or dates are quoted so a later parser does not change their type.
Can I convert an array at the root?
Yes. A JSON array becomes a YAML sequence. You do not need to wrap it in an object first.