24 converter Units · Currency · Files

Convert YAML to JSON YAML Ain't Markup Language ↔ JavaScript Object Notation Free Online Secure

Drop your YAML file in and take away JSON. 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 YAML file here, or choose one.

Your file never leaves this device. Everything runs in your browser.

About this converter
What it keeps Everything, because the two hold the same shapes: maps, lists, strings, numbers, booleans and null cross without loss. Anchors and aliases are expanded, so the result stands on its own.
What it cannot do Comments, blank lines and the choice between quoted and bare are how a YAML file reads, not what it means, and none of them survive — JSON has no place to keep them. A date written without quotes arrives as text, since JSON has no date. Custom tags are not honoured: only the standard types are read, which is also what keeps a file from asking for something this page does not have.
Where it runs In your browser. Nothing is uploaded, so there is nothing to delete afterwards.

Nothing uploaded

Convert from YAML

Convert to YAML

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 YAML to JSON

YAML is the notation that people choose when they have to write 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, static site settings, documentation tools and countless application configs. JSON is the notation that programs prefer to receive. It is strict, has no comments, and every programming language can read it with a standard library. When a file written for humans has to be handed to a program, an API or a tool that accepts only JSON, a conversion is needed. That is why people convert YAML to JSON: they have the data in the form that is pleasant to write, and the destination wants the form that is easy to parse.

The situations are everyday ones. A developer who maintains a configuration in YAML and has to send it to a service as JSON. A team that wants to validate a settings file with a tool that checks JSON. A writer who has front matter in YAML and wants to feed it to a script. A student who wants to see how the indentation of a YAML file maps to braces. In every case the data is the same, and only the notation changes.

This page converts YAML to JSON 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 is lost with the comments and what to expect from dates and tags.

How the conversion works

The same shapes in both notations

Your YAML is read inside your browser, and its structure is written out as JSON. The two hold the same shapes: maps, lists, strings, numbers, booleans and null cross without loss. A mapping in YAML becomes an object in JSON, a sequence becomes an array, and the scalar values keep their types. A line such as port: 8080 gives a number, and enabled: true gives a boolean.

Anchors and aliases are expanded

YAML has a feature that JSON lacks: you can mark a block with an anchor and refer to it elsewhere with an alias, to avoid repeating yourself. Anchors and aliases are expanded, so the result stands on its own. Each place where the alias appeared now holds a full copy of the block. The JSON is longer, but it needs no knowledge of anchors to be read.

Indentation becomes structure

In YAML, structure is expressed by indentation. In JSON, it is expressed by braces and brackets. The converter reads the indentation as the author meant it, and writes the braces for you. Mistakes in indentation, which are the commonest YAML errors, are reported rather than guessed at.

What is kept

Everything that is data

Everything is kept, because the two hold the same shapes: maps, lists, strings, numbers, booleans and null cross without loss. If it was a value in your YAML, it is a value in the JSON.

The order of keys

Keys keep the order in which they were written, so the JSON reads in the same sequence as the YAML.

Multi-line strings

Strings that span several lines in YAML, written with the block styles, are carried over as single strings with line breaks inside them, which JSON writes as escape sequences. The text is the same.

What you should know before you convert YAML to JSON

Comments and layout are gone

Comments, blank lines and the choice between quoted and bare are how a YAML file reads, not what it means, and none of them survive, because JSON has no place to keep them. If your YAML is full of explanatory comments, the JSON will have none of them. Keep the YAML as the file that people read and edit, and treat the JSON as a derived copy.

Unquoted dates arrive as text

A date written without quotes arrives as text, since JSON has no date. A line such as released: 2026-03-14 gives the string 2026-03-14. The program that reads the JSON must interpret it as a date if it needs one.

Custom tags are not honoured

Custom tags are not honoured: only the standard types are read, which is also what keeps a file from asking for something this page does not have. YAML allows tags that tell a particular program to build a particular object. Such instructions mean nothing here, and the converter does not follow them.

How to convert YAML to JSON here

Add your file

Drop the YAML 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 JSON 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 YAML and JSON

Two notations for the same data

YAML was designed to be easy for people to write and read. JSON was designed to be easy for programs to read and write. They overlap so far that JSON is nearly a subset of YAML, and a YAML reader can usually read JSON. The reverse is not true, because YAML has more features. To convert YAML to JSON is to go from the richer notation to the stricter one, and to give up the extras: comments, anchors and tags.

Why indentation errors matter

Because YAML relies on indentation, a misaligned line changes the meaning, and sometimes it still parses. A key that should have been inside a block ends up outside it. The JSON makes such mistakes visible, since the braces show exactly where every key landed. Converting is therefore also a handy way to check that a file means what you think it means.

Tabs

YAML does not allow tabs for indentation. If your file contains them, the conversion will report a problem. Replace the tabs with spaces and try again.

Common situations in detail

Configuration for services and tools

Many tools accept configuration in JSON only, or validate it against a JSON schema. Convert your YAML and use the result where JSON is required.

Checking what a file really says

When a YAML configuration behaves oddly, converting it to JSON shows the structure unambiguously. Misplaced keys and wrong types stand out.

Feeding scripts and APIs

An API that takes a JSON body can be given the content of a YAML file after conversion. It lets you keep the file in the form you like to edit.

Documentation and content files

Static site generators and documentation tools use YAML for front matter and data files. Converting them lets other tools read the same data.

Practical advice before you convert YAML to JSON

Check the indentation

Use spaces, not tabs, and keep the same width at each level. Most editors can show whitespace and highlight YAML errors.

Quote values that must stay text

A bare value such as yes, no or 1.0 may be read as a boolean or a number. If you mean text, put quotes around it. This protects version numbers, codes and country abbreviations.

Keep the comments in the YAML

Because comments do not survive, keep the YAML as the master, with its explanations, and regenerate the JSON when needed.

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

Where did my comments go?

They are gone. JSON has no place to keep comments, and they are how a file reads, not what it means.

Why is my date a string?

Because JSON has no date. A date written without quotes arrives as text.

What happens to anchors and aliases?

They are expanded, so the result stands on its own.

Why did my tag not work?

Custom tags are not honoured. Only the standard types are read.

Is my file uploaded?

No. The conversion runs in your browser and the file never leaves your device.

Can I go back to YAML?

Yes. JSON to YAML writes the data back in the readable form, though without the comments the original had.

Choosing wisely when you convert YAML to JSON

Is JSON really required?

If the receiving tool reads YAML, keep the YAML. Convert only when JSON is required.

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 YAML

The YAML is the master, with its comments and layout. Keep it, and treat the JSON as a copy.

Getting a good result after the conversion

Validate the JSON in a viewer

Open the result in an editor that understands JSON and collapse the objects. If the structure looks like what you expect, it is sound.

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.

Minify for transport

If the JSON will be sent over a network, tools exist that remove whitespace and make it lighter. The data stays the same.

Preparing your YAML so that it converts well

Keep it plain

When you convert YAML to JSON, plain YAML converts best: maps, lists and simple values. Features such as custom tags are ignored, and anchors only make the file longer.

Be explicit about types

Quote anything that looks like another type. Explicit is safer than clever, and the JSON will carry exactly what you wrote.

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.

Getting the most when you convert YAML to JSON

Use the conversion as a check

One of the best uses of the page is as a mirror. When you convert YAML to JSON, the braces show exactly how the indentation was understood. If a key sits at the wrong level, or a list swallowed an entry it should not have, it is plain to see in the result. Many people convert a configuration purely to confirm that it says what they meant.

Watch the common type surprises

YAML reads some bare words as other types. The word no may be read as false, a version such as 1.10 as the number 1.1, and a country code such as NO as a boolean in some readers. The converter follows the standard types, so values that look like numbers or booleans will be typed as such. If you want them to remain text, put quotes around them in the YAML before you convert.

Long strings and block styles

YAML offers block styles for long text, one that keeps line breaks and one that folds them into spaces. Both are read as the authors of the format intended, and the resulting string is written into the JSON with its line breaks as escape sequences. The text is the same, and the JSON is simply less pleasant for a human to read, which is the reason the YAML exists.

Several documents in one file

YAML allows more than one document in a single file, separated by three dashes. If your file has several, think about which one you want. Split them into separate files and convert each, so that every JSON file holds one document.

Secrets in configuration

Configuration files sometimes contain passwords, tokens and keys. Because the conversion happens in your browser, nothing is sent anywhere. Even so, do not leave the converted file in a shared folder or an email, and remove the secrets before you pass it on.

Keeping both formats in step

If a project needs both a YAML and a JSON version of the same data, treat one as the source and regenerate the other each time it changes. Whenever you convert YAML to JSON, do it from the current YAML, and do not patch the JSON by hand. In this way the two cannot drift apart.

Validating against a schema

Many tools check JSON against a schema, a description of which keys and types are allowed. A YAML configuration cannot always be checked directly, but its JSON form can. This is a common reason to convert YAML to JSON: to validate the file before it reaches a system that would reject it.

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 reports a YAML error

Look at the line it points to. Common causes are tabs used for indentation, a missing space after a colon, or a quote that does not close.

The structure is not what I expected

Check the indentation. A line that is one space off belongs to a different block than you intended.

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 JSON to YAML. For markup, XML to JSON and JSON to XML 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 your team keeps the settings of an application in a YAML file with comments, anchors for repeated blocks and a release date, and a monitoring tool wants the same settings as JSON. You drop the file here and press the button. A moment later you download a JSON in which the anchors are expanded, the date is a string and the comments are gone. You send it to the tool. The YAML stays in your repository, with its comments, as the file that people edit.

A short checklist

Before converting

Check the indentation. Quote values that must stay text. Keep the YAML.

While converting

Stay on the page until the file is ready.

After converting

Open the JSON, check the structure and the types, and test it with the tool that will read it.

Common mistakes

Expecting comments to survive

They do not. Keep the YAML for the explanations.

Leaving ambiguous values bare

Values such as yes, no and 1.0 may be read as another type. Quote them.

Using tabs

YAML does not allow tabs for indentation. Use spaces.

Your file stays on your device

The conversion happens locally. Your file is read by your own browser, rewritten there and handed back as JSON. 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 YAML to JSON.

Summary

To convert YAML to JSON 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, because the two hold the same shapes: maps, lists, strings, numbers, booleans and null cross without loss. Anchors and aliases are expanded, so the result stands on its own. Comments, blank lines and the choice between quoted and bare are how a YAML file reads, not what it means, and none of them survive, because JSON has no place to keep them. A date written without quotes arrives as text, since JSON has no date. Custom tags are not honoured: only the standard types are read.

Length & area Mass & volume Temperature Currency