YAML to JSON Converter

Pull simple key-value pairs out of YAML into JSON, in your browser. It reads flat top-level pairs only — lists and nested blocks are skipped.

Document Tools Free No upload Instant

Loading YAML to JSON Converter…

Your browser is preparing the tool. It runs 100% locally.

Quick Answer

Paste YAML and get JSON from its top-level key: value pairs. The tool reads each line, turns numbers into numbers and strips quotes from strings. It is deliberately simple: list items and nested blocks are not parsed — a key with an indented block becomes an empty object, and dash list items are skipped. For flat YAML it is quick and handy; for complex YAML, use a full parser. Runs in your browser.

What the YAML to JSON Converter Does

This extracts the flat, top-level key-value pairs from a YAML document and returns them as JSON. Each key: value line becomes a JSON property, with a numeric value turned into a number and surrounding quotes removed from a string.

It is not a complete YAML parser. Lists written as dash items and nested mappings are not read — a key followed by an indented block comes out as an empty object, and indented list items are skipped. It is built for simple, flat YAML.

How It Works

Paste or type YAML. The tool scans it line by line.

Each line that looks like a top-level key followed by a colon and a value becomes a JSON property. A bare number is stored as a number; otherwise the value is a string with any surrounding quotes removed.

A key with no value after the colon (an indented block beneath it) becomes an empty object. Copy the JSON or download it — all in your browser.

Data source & conversion logic

  1. Scan line by line. Each line is checked against a simple top-level key-value pattern.
  2. Match key-value pairs. Lines shaped as key: value are captured; other lines such as dash items and deeper nesting are skipped.
  3. Coerce the value. A numeric value becomes a number; otherwise it is a string with surrounding quotes stripped.
  4. Output JSON. The collected pairs are serialised as indented JSON to copy or download.

What it reads (and skips)

key: value at the top level = a JSON property numeric value = a number; otherwise a string (quotes stripped) key: with nothing after it = an empty object dash list items and indented blocks = skipped
Worked example
The YAML key: value followed by a list: line with two indented dash items becomes {"key": "value", "list": {}} — the dash items are not read, so list becomes an empty object.

This is a flat-pair extractor, not a YAML parser. For lists, nesting or anchors, use a full YAML library.

Privacy

Your YAML is parsed and converted entirely in your browser — there is no server and nothing is uploaded.

The data never leaves your device, so even sensitive records stay private.

No account, no stored copy; the conversion is gone when you close the tab.

Technical Details

InputYAML (flat key-value)
OutputIndented JSON (.json)
ReadsTop-level key: value pairs
SkipsLists and nested blocks
NumbersCoerced to numbers
QuotesStripped from strings
Processing100% in-browser

Standards & references

  • YAML (simplified subset) — Only flat top-level key-value lines are parsed; this is not a full YAML 1.2 implementation.
  • JSON (RFC 8259) — Output is standard JSON, pretty-printed with two-space indentation.

Accuracy & Limitations

This is a flat-pair extractor, not a real YAML parser. It reads top-level key-value lines and nothing else. Lists written as dash items are skipped, and a key with an indented block beneath it becomes an empty object.

Because nesting and lists are dropped, complex YAML loses data silently — you get only the simple top-level pairs. For anything beyond a flat map, use a full YAML library.

Value handling is basic: a value that is purely numeric becomes a number, and surrounding single or double quotes are stripped from a string. There is no boolean, null or date interpretation.

It does not understand anchors, multi-document streams, multiline block scalars, flow style, or comments — any line that does not match the simple key-value shape is ignored.

For dependable results, convert flat YAML only, or move to a dedicated parser. To produce YAML from JSON, use the JSON to YAML converter.

Real-World Use Cases

Grab config values

Pull the top-level settings out of a YAML config into JSON quickly.

Simple key-value YAML

Convert a flat list of key: value pairs into JSON for a script.

Quick peek

See the simple pairs of a YAML file as JSON without installing anything.

Prototype

Turn a handful of settings into JSON during early development.

When to use it — and when not to

Good for

  • Flat YAML that is only top-level key: value pairs
  • Quickly extracting simple settings as JSON
  • Throwaway conversions where nesting does not matter

Not the best choice for

  • YAML with lists or nested mappings — they are skipped
  • Booleans, nulls or dates that must be typed
  • Anchors, multiline scalars or multi-document YAML

For real YAML with lists and nesting, use a full YAML parser or library. To convert JSON into YAML, use the JSON to YAML converter.

Frequently Asked Questions

Does it parse nested YAML?
No. It reads only flat top-level key: value pairs. A key with an indented block beneath it becomes an empty object, because the block is not parsed.
Does it read list items?
No. Dash list items are skipped entirely, so a key whose value is a list comes out as an empty object.
Why is a nested key empty in my JSON?
A key followed by an indented block has no value on its own line, so the tool stores it as an empty object. The block beneath it is not read.
Are numbers converted?
Yes. A value that is purely numeric becomes a JSON number; everything else stays a string.
Are quotes handled?
Surrounding single or double quotes are stripped from a string value, so a quoted value becomes a plain JSON string.
Does it read booleans or null?
There is no special handling. A value like true or null stays a string unless it is purely numeric.
Does it support anchors or multiline strings?
No. It is a simple line matcher, not a full parser, so anchors, block scalars and flow style are not understood.
What happens to comments?
A comment line does not match the key-value shape, so it is ignored along with any other non-matching line.
Is this a full YAML parser?
No. It is a flat-pair extractor for simple YAML. For complex documents, use a dedicated YAML library.
Is the JSON indented?
Yes. It is pretty-printed with two-space indentation so it is easy to read.
Is my data uploaded?
No. The conversion runs entirely in your browser, so your data never leaves your device.
How do I go from JSON to YAML?
Use the JSON to YAML converter, which handles nested objects and arrays.

References

Reads your YAML line by line and converts the flat, top-level key: value pairs into JSON, coercing numbers and stripping surrounding quotes. It is a lightweight extractor, not a full YAML parser: list items and nested blocks are skipped. Runs entirely in your browser.

Popular

CSV to JSON Converter

CSV to JSON Converter online: fast, private and free for everyday document work.

DocumentOpen Tool
Popular

JSON to CSV Converter

Convert with JSON to CSV Converter, preserving structure and data, with zero uploads.

DocumentOpen Tool
Trending

Markdown to HTML

Markdown to HTML in seconds — accurate, free and processed locally in your browser.

DocumentOpen Tool

CSV to Excel Converter

Convert with CSV to Excel Converter, preserving structure and data, with zero uploads.

DocumentOpen Tool

Excel to CSV Converter

Excel to CSV Converter online: fast, private and free for everyday document work.

DocumentOpen Tool

Excel to JSON Converter

Convert with Excel to JSON Converter, preserving structure and data, with zero uploads.

DocumentOpen Tool

Ready to try the YAML to JSON Converter?

It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.