JSON to YAML Converter
Paste JSON on the left and get clean, correctly quoted YAML on the right — everything runs locally in your browser.
Options
Converted on your device — nothing is sent anywhere.
How it works
- Paste or type your JSON into the left panel — the YAML output updates live as you edit.
- Open Options to switch between 2-space and 4-space indentation, or force quotes around every string value.
- Click Copy YAML to put the result on your clipboard, or Download to save it as a .yaml file.
Frequently asked questions
- How does the converter decide when to quote a string?
- Strings are written as plain scalars whenever YAML allows it, which keeps the output readable. Quotes are added only when they are required: when a string looks like a number, boolean, or null, starts with a reserved character, contains a colon-space sequence, or has leading or trailing whitespace. If your target system prefers explicit quoting, the quote-all-strings option wraps every string value in double quotes.
- How are multiline strings converted?
- Strings containing line breaks are emitted as literal block scalars using the | indicator, which is the standard YAML way to keep text readable. The chomping indicator is chosen automatically: |- when the string has no trailing newline, | for exactly one, and |+ when trailing newlines must be preserved. Strings that cannot be represented safely as a block, such as those with trailing spaces on a line, fall back to double quotes.
- Is my JSON uploaded to a server?
- No. The parser and the YAML writer both run as JavaScript in your browser, and the page makes no network requests with your data. You can convert configuration files containing API keys or internal hostnames without them ever leaving your machine.
- Can I use the output in Kubernetes manifests or CI pipelines?
- Yes. The output is standard YAML that parses cleanly in Kubernetes, GitHub Actions, GitLab CI, Ansible, and Docker Compose. The default 2-space indentation matches the convention used in almost all of these ecosystems, and key order from your JSON is preserved exactly.
- Does the converter change my numbers or key order?
- Key order is kept exactly as it appears in the source JSON, and numbers are written using their standard JavaScript representation. Note that very large integers beyond 2^53 lose precision the moment JavaScript parses them — this is a limit of JSON parsing in every browser, not of the YAML writer. If you need exact big integers, keep them as strings in the source JSON.
About this tool
This tool converts JSON documents into clean, human-readable YAML directly in your browser. Paste any valid JSON — an API response, a package manifest, a configuration export — and the YAML equivalent appears instantly on the right, updating live with every keystroke. Parse errors are reported immediately with the message from the JSON parser, so malformed input is easy to track down before you copy anything.
The conversion happens entirely client-side. Your input is parsed with the browser’s native JSON parser and re-serialized by a purpose-built YAML writer: objects become indented mappings, arrays become dash lists, and strings are emitted as plain scalars unless YAML’s rules require quoting. Values that would be misread — strings like “true”, “003”, or anything starting with a reserved character — are double-quoted automatically, while multiline strings become literal block scalars with the correct chomping indicator. Because nothing is sent over the network, the tool is safe for secrets, tokens, and internal configuration.
Typical uses include translating a JSON API sample into a Kubernetes manifest fragment, converting exported settings into a docker-compose or CI workflow file, and turning package.json-style data into YAML front matter. Developers also use it in reverse workflows: keep the canonical data in JSON, convert to YAML for tools that demand it, and diff the results in version control since key order is preserved.
Two options cover the common style debates. The indent switch toggles between 2-space output, the convention in Kubernetes and GitHub Actions, and 4-space output preferred by some Ansible and Python-adjacent teams. The quote-all-strings toggle forces double quotes around every string value, which some linters and older YAML 1.1 parsers appreciate because it removes any ambiguity about type coercion. Use Copy for quick pastes and Download when you want a ready-to-commit .yaml file.