JSON to YAML Converter
Use the CaseSwitch JSON to YAML Converter to turn a JSON object or array into YAML for manifests, workflows, and human-edited config. Paste valid JSON, review the YAML, and copy it. Conversion runs in this browser — nothing is uploaded.
Written by the CaseSwitch editorial team. We maintain these tools in the browser so drafts, keys, and images stay on your device.
Last reviewed: 23 July 2026
Processed locally in your browser. Nothing is sent to a server.
Paste or type text to convert. Output stays empty until there is input.
Character count: 0 · Word count: 0 · Line count: 0
Examples
Simple object
Input
{"name":"app","port":3000}Output
name: app port: 3000
Nested list
Input
{"name":"app","port":3000,"tags":["a","b"]}Output
name: app port: 3000 tags: - a - b
Nested object
Input
{"server":{"host":"localhost","port":8080}}Output
server: host: localhost port: 8080
Array root
Input
[{"id":1},{"id":2}]Output
- id: 1 - id: 2
Boolean and null
Input
{"ok":true,"note":null}Output
ok: true note: null
How to use
- Paste valid JSON into the input panel.
- Review the YAML output and quote any strings that YAML might treat as booleans or numbers.
- Copy the result into your manifest or values file.
What this tool is for
YAML is the usual edit format for Kubernetes snippets, GitHub Actions, and many values files. JSON is stricter and common in APIs. This converter parses JSON and emits YAML with conventional indentation so you can draft a document in the syntax your tools prefer — without sending cluster-shaped samples to a third-party site.
How it works
JSON is parsed with JSON.parse. The value is then serialized with a YAML dumper (indent default 2, wide line width). Key order follows the object as parsed. Invalid JSON fails fast. JSON has no comments, so none appear in the output — add YAML comments yourself after conversion.
When to use it
Turning a JSON API example into a values.yaml draft, comparing the same data in two syntaxes, and preparing a workflow fragment from a JSON fixture. Validate Kubernetes kinds and apiVersions separately.
When not to use it
YAML 1.1 vs 1.2 gotchas (the “Norway problem”: NO as boolean) can still bite after conversion. Do not assume bit-identical round-trips for every float. This tool does not validate Kubernetes schemas. Huge arrays can become unreadable as YAML.
How it compares to related tools
YAML Formatter pretty-prints YAML you already have. JSON Formatter stays in JSON. CSV to JSON is for tabular imports, not YAML.
Common mistakes
Pasting JS objects with unquoted keys. Expecting comments to survive from JSON. Shipping converted YAML without quoting strings like NO, on, or off when they must stay strings.
Quote strings that look like booleans
Some YAML parsers still treat NO, yes, on, and off as booleans. After conversion, quote country codes and flag-like strings that must remain text. Prefer a quick read-through of enum-like fields before you apply a manifest.
Comments and Kubernetes shape
JSON cannot carry comments, so the YAML output is comment-free. Add explanations after conversion. Resource kinds, apiVersions, and CRD schemas are not checked here — the converter only changes serialization.
Frequently asked questions
Are comments preserved?+
JSON has no comments, so none appear. Add YAML comments after conversion.
Will this produce Kubernetes-ready YAML?+
It produces YAML for the data you pasted. Resource kinds, apiVersions, and schema checks are still your job.
Can I convert YAML back to JSON here?+
This page is JSON → YAML. Format existing YAML with the YAML Formatter, or convert in your editor if you need the reverse.
Why did my float look different?+
JSON and YAML number formatting can differ slightly after parse and dump. Check critical numeric fields.
Is my config uploaded?+
No. Conversion runs in this browser. Still avoid pasting live cluster secrets into screenshots.
Does key order stay stable?+
Order follows what JSON.parse produced for the object. Do not rely on key order as a security boundary.
Does this tool send my payload to CaseSwitch?+
No. Formatting, encoding, and naming conversions for this page run in your browser after load — your sample stays on the device.
Related tools
YAML Formatter
Cleaning a workflow file snippet, reviewing a Helm values fragment, normalizing list indentation, and teaching YAML structure on a short sample.
JSON Formatter
Debugging a 401 response, comparing two configs, preparing a gist, shrinking a JSON blob before embedding it in a test fixture, and checking whether a file is actually JSON before you commit it. If you need to escape a string as a JSON literal, use JSON Stringify instead. If you need YAML, use JSON to YAML after the JSON is valid.
CSV to JSON Converter
Fixture generation, prototyping a table UI, turning a small Sheets export into API-shaped JSON, and checking column names before wiring a mapper.
JSON Stringify
Normalizing an API sample to a team indent, re-serializing a one-line fixture with 4-space indent, and checking that a paste is valid JSON before you commit it. If you only need pretty vs minify toggles, the [JSON Formatter](/json-formatter-minifier/) is the sibling tool. If you need to recover text from a quoted JSON string literal, use [JSON Unstringifier](/json-unstringifier/).
JSON Unstringifier
Cleaning a message copied from a JSON log line, extracting body text from a quoted fixture field, reversing accidental double wrapping when you only need the inner string, and teaching how JSON string escapes work.