We use essential cookies to keep you signed in and protect forms. We also use analytics to count visits and see how pages are used. Ads on our free tools may set cookies to show and measure ads. Cookie notice
JSON to YAML
Turn JSON into YAML for config files. It happens in your browser.
Your files stay with you. Your files never leave your browser. This tool runs on your device: nothing is uploaded to our servers, so there is nothing for us to store or see.
How to use it
1Paste JSON or open a .json file.
2Pick the indentation and whether to sort keys.
3Copy the YAML or download data.yaml.
Where it helps
Config files
Write Kubernetes, Docker Compose or CI settings from JSON you already have.
Docs and specs
Turn a JSON example into YAML that's easier to read in documentation.
OpenAPI
Move an API description between JSON and YAML forms.
Good to know
Stays in your browser
Your text is processed on your device and never sent to our servers.
Paste JSON or open a .json file, pick the indentation and whether to sort keys, then copy the YAML or download data.yaml. Strings that could be mistaken for numbers or booleans, such as "true" or "411001", are quoted so they keep their type. The JSON must be strict, and errors show the line and column.
QuotedAmbiguous strings.Type kept.
OrderKeys kept.Unless you sort.
2 or 4Indent.Your choice.
StrictJSON input.Errors located.
Will the YAML mean exactly the same as my JSON?
Yes. Strings that could be mistaken for numbers or booleans, such as "true" or "411001", are quoted so they keep their type when the YAML is read back. Numbers, booleans, nulls, lists and nested objects map directly, so a round trip through YAML to JSON gives the same data.
Why is my JSON rejected?
It must be strict JSON: double quotes, no comments and no trailing commas. The error tells you the line and column of the first problem. If you copied a JavaScript object, convert single quotes to double quotes and remove comments, or check it in the JSON formatter first.
Does it keep the order of keys?
Yes, unless you turn on Sort keys. Keeping the order matters for config files that people read, where related settings sit together. Sorting is useful when you want to compare two files in a diff tool, because the same keys then line up in the same places.
Is my data uploaded?
No. Your text is processed in your browser and never sent to our servers, and nothing is kept after you close the page. That keeps internal settings, hostnames and API details private. Avoid pasting real passwords or keys on a shared computer, as a general habit.
Why use YAML instead of JSON?
YAML is easier for people to read and edit: no braces or quotes around most values, and it allows comments. That's why Kubernetes, Docker Compose, GitHub Actions and many CI tools use it. JSON is stricter and better for machines and APIs to exchange. Converting between them keeps the same data.
How are lists written in YAML?
Each item in a JSON array becomes a line starting with a dash and a space, indented under its key. A list of objects puts the first key on the dash line and the rest indented below it. The output follows the common style that Kubernetes and CI files use.
Which indentation should I choose?
Two spaces is the most common style for YAML and is what Kubernetes and GitHub Actions examples use. Four spaces can be easier to read for deep nesting. YAML never allows tabs for indentation, so the tool always uses spaces whichever width you pick. Two spaces is the default.
Can I add comments to the YAML?
Yes, after converting. JSON has no comments, so the output has none, but YAML allows them with a hash sign. Add notes explaining important settings once you've pasted the YAML into your file. Comments are a big reason teams prefer YAML for configuration. Explain why, not just what.
How are long strings handled?
Strings are written in a safe form, quoted where needed so special characters and line breaks are kept exactly. You can reformat a long text as a YAML block string with | afterwards if you prefer, but the generated form is always read back correctly. Lines are never wrapped mid-string.
Can I convert an OpenAPI spec?
Yes. OpenAPI and Swagger files can be written in JSON or YAML, and the content is the same. Paste the JSON spec to get YAML that's easier to review and comment on. Check the result in your API tooling to confirm it reads the file as expected.
What happens to null values?
JSON null becomes null in YAML, which every parser reads back as null. Empty strings are quoted as '' so they don't turn into null by accident. That small detail matters in config files, where a missing value and an empty one can behave differently. Check those keys after converting.
Is there a size limit?
Conversion runs in your browser, so very large files depend on your device's memory. Config files and API specs convert instantly. For huge data dumps, YAML isn't a good format, and keeping the data in JSON is usually the better choice. Most real config files are small enough to convert in an instant.
Can I round-trip back to JSON?
Yes. Paste the YAML into the YAML to JSON converter and you get the same data back, because ambiguous strings were quoted. That's a quick way to check a hand-edited YAML file still means what you intended before you deploy or commit it. Compare the two JSON files to spot changes.
Does it work on a phone?
Yes. Paste JSON or open a file on your phone, then copy or download the YAML. Reviewing long config files is easier on a bigger screen, but the conversion runs entirely in your mobile browser with no app and nothing sent to a server. It suits quick checks.
Is the JSON to YAML converter free?
Yes. It's free with no sign-up and no limit on use. It's one of the free developer tools from Marketiism, along with the YAML to JSON converter and the JSON formatter. Marketiism builds software for small Indian businesses. Use it as often as you need.
Want this inside your own account?
Marketiism keeps your invoice numbers, GST reports, UPI payment links and WhatsApp reminders in one place. Leave your details and we'll call to set it up for your business, or start the trial yourself.