Convert JSON to YAML JavaScript Object Notation ↔ YAML Ain't Markup Language Free Online Secure
Drop your JSON file in and take away YAML. It is read and written here, in your browser, so the file never leaves your device — and what the crossing keeps, and what it cannot, is written out below rather than left for you to discover.
Convert your file
Drop your JSON file here, or choose one.
Your file never leaves this device. Everything runs in your browser.
Nothing uploaded
Convert from JSON
Convert to JSON
Where these formats come from
CSV is the oldest and the least standardised: a table written as lines of text, in use since the 1970s and only described in writing in 2005, by which time every program had already decided for itself what the separator was and when to put quotation marks. XML grew out of SGML in 1998 for documents that must carry strict structure and be checked against a schema. JSON was pulled out of JavaScript by Douglas Crockford around 2001, deliberately stripped down to objects, arrays, numbers and strings — and that minimalism is why it took over the web. YAML is its readable cousin, where indentation does the work that brackets do elsewhere. The one thing that matters when converting between them: CSV is flat, a grid of rows and columns, while JSON, XML and YAML are trees.
Where you meet them
CSV is what a spreadsheet exports and what an accountant, a shop platform or a bank statement will hand you. JSON is what web services speak and what configuration files are increasingly written in. XML survives in older enterprise systems, in invoicing standards and inside the office formats themselves. YAML is where humans write settings by hand. Converting between them is the daily work of moving data from where it was produced to where it is needed.
Questions people ask
My CSV opened as one column in Excel. Why?
Because your spreadsheet expected a different separator. Excel follows the list separator of the computer's regional settings, which is a semicolon anywhere the comma is already the decimal mark — that is, most of continental Europe. A file separated by commas then looks like a single column of text. Use the import dialogue and state the separator explicitly, rather than double-clicking the file. The same regional setting is why 3.5 sometimes arrives as a date.
Why can't my nested JSON become a tidy spreadsheet?
Because a spreadsheet is flat and JSON is a tree. A row can hold one value per column; a JSON object can hold a list inside a field inside another list. Converting means choosing how to flatten that: either joining nested names into one long column heading, or repeating the parent row once for each child. Both are compromises, and neither can be undone automatically — which is why going back from the spreadsheet to the original shape usually needs a human decision.
Does the file lose quality?
It depends on what the two formats can hold. Converting between formats that store the same thing — a PNG to a BMP, a WAV to a FLAC — loses nothing. Converting into a format that throws information away to save space, such as JPEG or MP3, loses a little every time, and converting back does not bring it back. Where a choice exists, this page errs towards keeping the original quality rather than making the smallest file.
Is my file uploaded anywhere?
No. The conversion happens inside your browser, on your own machine; the file never leaves it and there is no server here that could receive it. That is why a large file is limited by your own memory rather than by an upload, and why nothing you convert can appear in anybody's logs — including ours. The audio and video tools do fetch their conversion engine from this site the first time you use them, some thirty megabytes once; after that the work still happens entirely on your machine.
Why people convert JSON to YAML
JSON is the notation that programs love: strict, compact and understood by every language. But it is not kind to people. A long JSON file is a thicket of braces, brackets, quotation marks and commas, with no room for a comment and a trailing comma that can break everything. YAML is the notation that people choose when they must read and edit data by hand. It uses indentation instead of braces, allows comments and reads almost like an outline, which is why it became the favourite for configuration: build pipelines, container definitions, deployment files, settings of static sites and documentation tools. When data arrives as JSON and you want to work with it in a form that is pleasant to read, a conversion is needed. That is why people convert JSON to YAML.
The situations are everyday ones. A developer who has the output of a tool in JSON and wants to turn it into a configuration file. A team that is moving settings from one system to another and prefers a readable format. A writer who wants to read the structure of an API answer without the clutter. A student who wants to see how braces map to indentation. In every case the data is the same, and only the notation changes.
This page converts JSON to YAML in your browser. Your file is read and written here, so it never leaves your device, which matters for configuration files, which often hold addresses, names of internal systems and sometimes secrets. And the page tells you in advance what the crossing keeps and what it cannot, rather than leaving you to discover it. Below you will find how the conversion works, what happens with deep nesting and long strings and how to get a tidy result.
How the conversion works
The same shapes in both notations
Your JSON is read inside your browser, and its structure is written out as YAML. The two hold the same shapes, and everything is kept in both directions: maps, lists, strings, numbers, booleans and null. An object in JSON becomes a mapping in YAML, an array becomes a sequence, and the scalar values keep their types. A key port with the number 8080 gives port: 8080, and a key enabled with true gives enabled: true.
Repeated structures are written out in full
YAML has a way of avoiding repetition, with anchors and aliases. The converter does not use it. Repeated structures are written out in full rather than as anchors, so the file reads straight down. This makes the YAML a little longer, but nothing in it needs to be looked up elsewhere, and any reader can understand each block on its own.
Keys keep their order
Keys keep their order as JSON had them. The YAML reads in the same sequence as the source, so someone who knows the JSON will find their way at once.
What is kept
Everything that is data
Everything is kept, in both directions: maps, lists, strings, numbers, booleans and null. If it was a value in your JSON, it is a value in the YAML, with the same type.
Strings that need protection
Some strings would be misread in YAML if written bare: the word true, a number in quotes, a text containing a colon. The converter quotes such strings so that they come back as strings and do not turn into booleans or numbers. A JSON string that says "true" stays a string in the YAML.
Unicode
Accented letters, symbols and characters from other alphabets are kept as they are, so a file in several languages stays readable.
What you should know before you convert JSON to YAML
Deep nesting means deep indentation
YAML puts meaning in its indentation, so a value that ends up deeply nested becomes a deeply indented file: readable, but not short. A JSON tree of eight levels gives lines that start far from the left margin. If that becomes unwieldy, consider flattening the structure at its source.
Long strings are wrapped
Long strings are wrapped at about a hundred columns, which changes where the line breaks fall without changing the value. A paragraph that was a single long line in the JSON appears over several lines in the YAML, but it is the same text. A program that reads the YAML receives the original string.
Comments cannot be invented
YAML allows comments, but JSON carries none, so the result has none. You can add explanations by hand afterwards, which is one of the main reasons to have the file in YAML in the first place.
How to convert JSON to YAML here
Add your file
Drop the JSON file onto the page or pick it from your device. It is read inside your browser and is not uploaded.
Convert
Press the button. A file of ordinary size takes a moment. Leave the page open until it is done.
Download and check
Download the YAML and open it in a text editor. Look at the start and the end, and check that the structure and the types are what you expect.
A closer look at JSON and YAML
Two notations for the same data
JSON was designed to be easy for programs to read and write. YAML was designed to be easy for people. They overlap so far that JSON is nearly a subset of YAML, and a YAML reader can usually read JSON. To convert JSON to YAML is therefore not to change the data but to re-dress it, in a form that has room for notes and no clutter of punctuation.
Why indentation needs care
Because YAML relies on indentation, a misaligned line changes the meaning. The converter writes the indentation consistently, with spaces and with the same width at each level, so the file is correct as produced. When you edit it later, keep the same width, and avoid tabs, which YAML does not allow for indentation.
Readable but not always shorter
YAML is often described as more compact than JSON, because it drops the braces and the quotation marks around keys. For flat data this is true. For deeply nested data, the indentation can make it longer in characters. The gain is in readability, not in size.
Common situations in detail
Turning tool output into configuration
Tools often print their settings or results as JSON. Convert JSON to YAML, add comments and keep it as the configuration file that people maintain.
Moving settings between systems
Moving a configuration from a system that uses JSON to one that uses YAML is a matter of one conversion, followed by a check that the target accepts the keys.
Reading an API answer
The answer of an API can run to hundreds of lines of braces. In YAML, the same data reads like an outline, and you can see the structure at a glance.
Teaching and documentation
Showing the same data in both notations is a good way to teach how structured data works. Documentation that uses YAML examples is often easier to read.
Practical advice before you convert JSON to YAML
Check that the JSON is valid
A stray comma or a missing quote will stop the conversion. If the page reports an error, open the file in an editor that highlights JSON problems and fix the line it points to.
Flatten where you can
If the structure is deeper than it needs to be, simplify it first. A flatter structure gives a YAML that is easier to read and edit.
Think about the consumer
Look at what will read the YAML. Some tools expect particular key names and types, and it is easier to adjust the JSON beforehand than to edit the YAML afterwards.
Large files
Everything runs on your device, so a very large file needs memory. For files of many megabytes, use a computer, and split the data if the page struggles.
Questions people ask before converting
Will my data be changed?
No. Everything is kept in both directions: maps, lists, strings, numbers, booleans and null.
Why are my long strings split over several lines?
Long strings are wrapped at about a hundred columns. This changes where the line breaks fall without changing the value.
Why is my file so indented?
Because the data is deeply nested, and YAML expresses nesting by indentation.
Where are the anchors?
Repeated structures are written out in full rather than as anchors, so the file reads straight down.
Is my file uploaded?
No. The conversion runs in your browser and the file never leaves your device.
Can I go back to JSON?
Yes. YAML to JSON reads the file back, though any comments you added will not survive.
Choosing wisely when you convert JSON to YAML
Is YAML really needed?
If the receiving tool reads JSON, keep the JSON. Convert when people must read and edit the file, or when the tool requires YAML.
Other targets
If the destination is a markup file, JSON to XML can follow. For tables, JSON to CSV and JSON to XLSX serve spreadsheets.
Keep the JSON
The JSON is the master if it comes from a program. Keep it, and regenerate the YAML when it changes.
Getting a good result after the conversion
Add comments
The result has none, and this is where YAML shines. Add a short note above each block to say what it does and what values are allowed.
Check the types
Look at values such as versions, codes and flags. Make sure they are strings where you meant strings and numbers where you meant numbers.
Keep the indentation consistent
When you edit, use spaces and keep the same width at each level. An editor that shows whitespace and checks YAML will save you from errors.
Preparing your JSON so that it converts well
Keep it regular
When you convert JSON to YAML, regular data converts best: consistent keys and clear types. Irregular data gives a correct but untidy result.
Name keys clearly
People will read the YAML, so choose keys that say what they mean. A configuration is easier to maintain when its names are plain.
Test with a small piece first
If your file is large, take a section into a test file and convert that. A quick look at the result shows whether the structure is what you expect.
Working with the YAML after you convert JSON to YAML
Add the notes that JSON could not hold
The first thing to do with a freshly converted file is to read it from the top and add comments where a stranger would be puzzled. A short line above a section saying what it controls is worth more than a page of documentation kept elsewhere, because it sits beside the thing it describes. This is the main advantage you gain when you convert JSON to YAML.
Group related settings
Keys keep the order they had in the JSON, which may be the order a program happened to emit them. In YAML you are free to rearrange them so that related settings sit together, with a blank line between groups. Because the order of keys in a mapping carries no meaning for most readers, this is safe, but check the tool you use in case it cares.
Check what the receiving tool expects
A valid YAML file is not necessarily a valid configuration. Tools expect particular keys and types, and some are strict about unknown keys. After the conversion, compare the file with the documentation of the tool, and run its own checker if it has one.
Use version control
Configuration in YAML is easy to compare line by line, which makes it a good fit for version control. Commit the converted file and let colleagues see each change as a clear difference, which was much harder with a single line of minified JSON.
Mind the secrets
JSON exported from tools sometimes includes tokens and passwords. Because the conversion happens in your browser, nothing leaves your device, but the YAML file will contain the same secrets. Remove them, or move them to a safer place, before you commit or share the file.
Keep an eye on indentation when editing
Once you start editing by hand, the main risk is a line that is one space out of place. Use an editor that shows whitespace and checks YAML as you type, and keep the same width at every level, as the converter did.
Convert again when the source changes
If the JSON is produced by a program and changes from time to time, convert JSON to YAML again for each new version, and merge your comments from the old file into the new one. A comparison tool makes this a matter of minutes.
Privacy and handling
Why local conversion matters for configuration
Configuration files often hold addresses, names of internal systems and sometimes keys and passwords. Many online converters upload your file to a server, process it and send back the result, and for a while a copy lives on a machine you do not control. Here your own browser does the work, so the file stays on your device.
What happens when you leave
When you close the page, the converted file disappears from the browser, so download it first. Nothing about your file is kept.
If something goes wrong
The page says the file is not valid JSON
There may be a stray comma, a missing quote or a bracket that does not close. Open the file in an editor that highlights JSON errors and fix the line it points to.
The tool rejects the YAML
Check the key names and the types it expects. The YAML is valid, but the tool may want different names or a different structure.
The page freezes with a large file
Everything runs on your device, and a large file needs memory. Try again on a computer, or split the data.
Related tools
The same family of tools covers the neighbouring jobs. To go back, use YAML to JSON. For markup, JSON to XML and XML to JSON convert between those two. For tables, there are JSON to CSV, CSV to JSON, JSON to XLSX and XLSX to JSON.
A worked example
Say a tool prints its settings as a JSON file of 150 lines, and you want to keep them in your repository as a configuration that colleagues can read and comment on. You drop the file here and press the button. A moment later you download a YAML of about 90 lines in which the structure reads like an outline. You add a comment above each section, commit it and tell the team where to edit. The JSON remains as the output of the tool.
A short checklist
Before converting
Check that the JSON is valid. Simplify deep nesting if you can. Keep the JSON.
While converting
Stay on the page until the file is ready.
After converting
Open the YAML, check the structure and the types, add comments and test it with the tool that will read it.
Common mistakes
Expecting a shorter file
Deep nesting makes deep indentation. YAML is more readable, not always smaller.
Editing with tabs
YAML does not allow tabs for indentation. Use spaces.
Losing the source
If the JSON comes from a program, keep it and regenerate the YAML when it changes.
Your file stays on your device
The conversion happens locally. Your file is read by your own browser, rewritten there and handed back as YAML. Nothing is uploaded, so no copy ends up on a server and nobody else can read it. For configuration with private content, that is the safe way to convert JSON to YAML.
Summary
To convert JSON to YAML here, drop the file and press the button. It is read and written in your browser, so the file never leaves your device. Everything is kept, in both directions: maps, lists, strings, numbers, booleans and null. Repeated structures are written out in full rather than as anchors, so the file reads straight down. YAML puts meaning in its indentation, so a value that ends up deeply nested becomes a deeply indented file, readable but not short. Long strings are wrapped at about a hundred columns, which changes where the line breaks fall without changing the value. Keys keep their order as JSON had them.