All processing happens in your browser. Your file is never uploaded to any server.
Paste YAML
Upload File

Click to select or drag & drop a .yaml or .yml file


    
What JSON could not keep

All conversion runs in your browser. Your data is never uploaded to any server.

YAML to JSON

This free YAML to JSON converter turns YAML into JSON entirely in your browser. Paste your YAML or upload a .yaml or .yml file, choose which YAML version decides the types, read the JSON, and download a .json file. Nothing leaves your device, and there is no sign-up.

The reason this conversion loses data is not formatting — it is that YAML can express things JSON cannot. YAML has comments, dates, anchors and aliases, non-string keys, .inf, .nan, and several documents in one file. JSON has none of those. Most converters drop them silently. This page does the opposite: it types your values against a named resolver — YAML 1.2 core schema or YAML 1.1, your choice — and then lists every value where it had to make a decision, with the reason.

How to use this YAML to JSON converter

What this tool supports

Typing: which YAML version decides

A plain value in YAML is not typed by how it looks, it is typed by the resolver of the parser that reads it. That is why the same file produces different JSON in different tools. This page makes you choose the resolver, and the choice changes the result for these values:

YAML you wroteUnder YAML 1.2 core schemaUnder YAML 1.1
yes / no"yes" — a stringtrue / false
on / off"on" — a stringtrue / false
y / n"y" — a stringtrue / false
0077 — a decimal integer7 — an octal integer (same number, different rule)
01919 — a decimal integer"019" — a string, because 9 is not an octal digit
1_000"1_000" — a string1000 — underscores ignored
0x1F3131
190:20:30"190:20:30" — a string685230 — base-60 integer
2001-12-14"2001-12-14" — a stringstring "2001-12-14", reported as a date
1.01 — a number1 — a number
~ or empty valuenullnull

If you do not know which one your pipeline uses, choose YAML 1.1 when the file was written for older tooling (PyYAML before 5.1, Ruby, Symfony) and YAML 1.2 when it was written for Go, JavaScript or Kubernetes-flavoured tooling. When in doubt, the report panel tells you exactly which values changed their type.

Things JSON cannot keep

In your YAMLWhat this page writesWhy
# commentdropped, counted in the notesJSON has no comment syntax
released: 2001-12-14"2001-12-14"JSON has no date type, so the original text is kept as a string
ratio: .infnull, or "Infinity" if you pick as stringJSON has no Infinity
ratio: .nannull, or "NaN" if you pick as stringJSON has no NaN
1: one (integer key)"1": "one"JSON object keys are always strings
true: yes (boolean key)"true": trueJSON object keys are always strings
? [a, b] style complex keysthe key rendered as a stringJSON object keys are always strings
big: 12345678901234567890"12345678901234567890"bigger than JSON numbers hold exactly (2^53), kept as text so no digit is lost
&a value then *athe alias is replaced by a copy of the valueJSON has no references
<<: *basethe anchor's entries copied into the mappingmerge keys are a YAML feature
--- between documentsfirst document, or an array of all of themJSON is a single document unless you wrap it

Multi-line strings

Block scalars are read the way YAML defines them. A literal block (|) keeps every line break; |- strips the trailing newline, |+ keeps them all. A folded block (>) joins lines with spaces and turns blank lines into real newlines. Whatever the block produces becomes one JSON string, with \n escaped.

Nulls, empty values, empty collections

A key with no value, ~, and null all become JSON null. An empty flow collection {} becomes {} and [] becomes [].

Key order

Keys come out in the order they appear in your YAML. Nothing is sorted or reordered, and duplicate keys keep the position of the first one while the later value wins — the report says so.

Privacy and limits

Parsing happens in your browser with JavaScript only. No file is uploaded, nothing is stored after you close the tab, and there is no account. Because everything runs in your browser's memory, very large files (tens of MB) depend on your device; typical configuration files and API dumps convert instantly.

What this tool does not do

Frequently asked questions

Is this YAML to JSON converter free?

Yes. No account, no sign-up, no conversion limit, and no upload — the work happens in your browser.

Is my YAML uploaded anywhere?

No. The file you pick is read with the browser's own File API and parsed in the page. There is no request that carries your data.

Can I convert a .yml file, not just .yaml?

Yes. The file picker accepts .yaml, .yml and .txt, and pasting works for any of them. The two extensions mean the same format.

Why did my yes become true?

Because the resolver is set to YAML 1.1, where yes, no, on, off, y and n are booleans. Switch Resolve types as to YAML 1.2 (core schema) and the same file gives you the string "yes".

Which version should I pick if I do not know?

Pick YAML 1.1 if the file is consumed by older tooling that expects booleans from yes/no and integers from 007. Pick YAML 1.2 for modern stacks. Either way the report under the output names every value whose type depends on that choice.

Where did my comments go?

JSON has no comment syntax, so they are dropped. The note under the output tells you how many were removed. If you need to keep them, keep the YAML as the source of truth.

My file has several documents separated by ---. What happens?

By default only the first document is converted. Switch Multiple documents to As an array and you get a JSON array with one element per document.

Why is my date a string?

JSON has no date type, so a YAML timestamp becomes a string holding the original text. Anything reading the JSON has to parse it back into a date on purpose.

Why did my key 1 become "1"?

JSON object keys are always strings, so a YAML integer, boolean or null key is written as text. The report lists every key this happened to.

Do anchors and aliases work?

Yes. An alias is replaced by a copy of the value its anchor points at, and merge keys (<<: *base) copy the anchor's entries into the mapping. A self-referencing alias is reported as an error instead of hanging the page.

Is there a file size limit?

There is no imposed limit. Parsing happens in your browser's memory, so extremely large inputs (tens of MB) may be slow depending on your device. Configuration files and API exports convert instantly.

Why does it say my YAML is invalid?

The error names the line. The usual causes are a tab used for indentation, an unterminated quote, a mapping key without its colon, or an alias whose anchor does not exist. Fix the named line and it converts.

Can I go the other way?

Yes — use the JSON to YAML converter for the reverse direction. If the next stop is a spreadsheet or an API payload, the JSON to Excel and JSON to XML pages take it from there, and CSV to JSON handles tabular input.