Convert JSON to clean YAML — block scalars for multiline strings, optional key sorting, 2/4-space indent, line-numbered errors — browser-only
- Runs locally
- Category Format Converter
- Best for Turning pasted content or local files into a handoff-friendly format.
What this tool does
Free online JSON to YAML converter that turns any valid JSON into clean, readable YAML 1.2 entirely in your browser. Nested objects and arrays become proper block style, multiline strings collapse into literal block scalars (the `|-` form) instead of ugly escaped one-liners, and strings that contain a colon-space, a leading `#`, a leading `-`, or any other YAML-ambiguous character are automatically quoted so the output parses back cleanly. Booleans, nulls and numbers keep their real types — `true` stays a boolean, `"true"` stays a quoted string. Choose 2- or 4-space indentation, optionally sort object keys alphabetically (handy for diffing two configs), then copy or download a ready-to-commit `.yaml` file. Invalid JSON gets a clear error with the character position so you can fix it in place. Nothing is uploaded — the conversion is plain JavaScript running on this page, so API responses, Kubernetes secrets and CI configs never leave your tab.
Tool details
- Input
- Text + Numbers + Structured content
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy + Download
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 30 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Format Converter · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How JSON to YAML Converter fits into your work
Use it when the main problem is getting content from one practical format into another.
Conversion jobs
- Turning pasted content or local files into a handoff-friendly format.
- Previewing a conversion before you use it in a larger workflow.
- Cleaning small format mismatches without opening a full editor.
Conversion checks
- Try a small sample first when the source format is messy.
- Check character encoding, separators, and line endings after conversion.
- Keep the source until the converted output has been reviewed.
Good next steps
These links move the current task into a more complete workflow.
- 1 YAML ⇄ JSON Converter Convert between YAML and JSON — both directions, pretty-printed, error messages with line numbers — browser-only Open
- 2 JSON Formatter & Validator Format, validate, and minify JSON instantly — right in your browser. Open
- 3 JSON Minifier Minify JSON into a compact single line, optionally sort object keys, and keep everything local. Open
Real-world use cases
Turn a curl JSON response into a Kubernetes manifest
You hit an API with `curl`, got back a JSON object, and now need it as a YAML ConfigMap entry. Steps: copy the JSON body straight from the terminal, paste it into the input, leave indent at 2 (kubectl's house style), copy the YAML output, and drop it under `data:` in your manifest. The colon-bearing values (timestamps like `2026-05-29T10:30:00Z`, ratios like `cpu: 250m`) come out correctly quoted so `kubectl apply` does not choke on a mis-parsed map key.
Migrate a package.json scripts block to a GitHub Actions YAML step
You have a JSON object of npm scripts and want each as a workflow step. Paste the `"scripts"` object, switch indent to 2 to match `.github/workflows`, and read the YAML. Multiline commands (a script with embedded `&&` chains broken across lines) render as a `|-` block scalar, which is exactly what a `run:` step wants — no more hand-escaping quotes inside a one-line string.
Diff two API configs that only differ in key order
Staging and prod return the "same" config JSON but the keys come back in different orders, so a naive diff lights up red on every line. Paste each one, turn on Sort keys, copy both YAML outputs into a diff tool. Now the only highlighted lines are the values that genuinely differ (the prod database host, the higher replica count) — the ordering noise is gone.
Author a docker-compose override from a JSON snippet
A teammate sent you service settings as JSON in Slack. Paste it, keep indent at 2, copy the YAML, and paste under the service name in `docker-compose.override.yml`. Environment values that look like booleans (`"true"`, `"false"`) stay quoted strings so Compose does not silently coerce a string flag into a YAML boolean and break the container's env parsing.
Convert a JSON i18n bundle to a YAML locale file
Your translation tool exports JSON but your framework (Rails, Symfony, many static-site generators) wants `.yml` locale files. Paste the flat or nested JSON of message keys, download the result as `en.yml`, and commit. Strings containing apostrophes, leading dashes ("- see below"), or interpolation tokens are quoted automatically, so a single odd translation string can't break the whole locale file at load time.
Common pitfalls
Pasting JavaScript object literals instead of JSON. `{ name: 'x', port: 8080, }` has unquoted keys, single quotes, and a trailing comma — all illegal JSON. This is a JSON-to-YAML converter, not a JS-to-YAML one: run the object through JSON.stringify first (or use a JSON formatter to validate), then paste the strict JSON.
Expecting comments to survive. JSON has no comment syntax, so there is nothing to carry into the YAML output. If you need commented YAML, add the `#` comment lines by hand after converting — the tool will not invent them.
Assuming `yes`/`no`/`on`/`off` become YAML booleans. Under YAML 1.2 (what this tool emits) they stay plain strings. If a downstream YAML 1.1 parser still treats `yes` as a boolean, quote the value in your source JSON as `"yes"` so the intent is unambiguous on both sides.
Reusing 4-space indent where the target tool expects 2. Kubernetes, GitHub Actions and docker-compose all conventionally use 2-space indent; pasting 4-space YAML there is valid but stands out in review. Match the indent dropdown to the destination before copying.
Privacy
The JSON-to-YAML conversion is plain JavaScript (JSON.parse plus the eemeli/yaml stringifier) that runs in this browser tab. No JSON is uploaded, no analytics record what you convert, and the download button builds the `.yaml` file locally from an in-memory Blob. One caveat: the input is mirrored into the shareable URL (the `?in=` slot, capped at ~1800 chars). That is great for sending a colleague a "see this exact conversion" link, but it means anything you type can show up in browser history and in the access log of wherever you paste the URL. For a config that carries real secrets — a token, a private key, a database password — copy the YAML output directly instead of sharing the URL, and clear the input when you are done.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- 555 Timer Calculator Astable f = 1.44/((R1+2R2)C) + monostable t = 1.1RC — pick R1, R2, C in Ω/kΩ and µF/nF, read frequency, duty cycle and pulse width — browser-only
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only