Convert JSON to YAML
Convert JSON to YAML in your browser: load your JSON, choose YAML as the target, and download the result. The converter reports exactly what it could not carry across, and nothing is uploaded to a server.
Convert JSON to YAMLRuns in your browser. Nothing uploaded.
When you need this
Kubernetes, Docker Compose, GitHub Actions and Ansible all read YAML, while almost everything that generates configuration emits JSON. This conversion is the usual last step before a manifest goes into a repository, and the reason the result is reviewed by a human is that YAML is the format people are expected to edit afterwards.
How to convert JSON to YAML
- Load your JSON
- Drag the .json file in, paste the text, or open it straight from a URL — an API response usually arrives as a paste. Nothing leaves your browser at this or any later step.
- Choose the target format
- Press Ctrl+Shift+K (Cmd+Shift+K on a Mac) to open the conversion panel, then pick YAML as the target. The source and the result sit side by side.
- Read the loss report
- The panel shows whether the conversion is lossless for your particular data, and lists every value it had to transform. Adjust indentation, key sorting and null handling if you need to.
- Take the YAML
- Download the .yaml file, copy it, or open it as a new tab to keep working on it in the YAML views.
What survives the conversion
JSON to YAML cannot be lossless, because the two formats express different things. Integers beyond 2^53 lose precision, and there is no YAML spelling for Infinity or NaN.
- Integers beyond 2^53 lose precision. JSON numbers are IEEE 754 doubles, so a 19-digit identifier has already been rounded before YAML ever sees it — the loss happens on read, not on write, and no converter can recover it.
- YAML has no spelling for Infinity or NaN. JSON has no way to express them either, so this only matters if the JSON came from a non-conforming producer.
- Strings that look like other types get quoted.
"true","1.0"and"null"are emitted with quotes, because a YAML parser would otherwise read them back as a boolean, a float and a null.
A worked example
A string that must stay a string, and one that need not be:
{
"port": 8080,
"version": "1.0",
"debug": false
}port: 8080
version: "1.0"
debug: falsePrivacy
The conversion runs in your browser — in a Web Worker for anything above a quarter of a megabyte, so the page stays responsive. Your data is not uploaded, not logged and not stored. There is no account, and the whole thing works offline.
Questions
Why did my version number gain quotes?
Because 1.0 unquoted is a YAML float, and reading it back would give you the number 1 rather than the string "1.0". The quotes are what preserve the value you started with. Anything whose unquoted form a YAML parser would interpret as a different type is quoted for the same reason.
Is converting JSON to YAML lossless?
No, and no tool can make it so. Integers beyond 2^53 lose precision, and there is no YAML spelling for Infinity or NaN. The converter lists every affected value rather than silently dropping it.
Is my JSON uploaded to a server?
No. The file is read and converted by your browser. Nothing about its contents is sent anywhere, which you can verify in your browser’s network panel or by using the tool with the network disconnected.