tuliq
Runs in your browser

YAML ↔ JSON Converter

Convert between YAML and JSON, in both directions — paste directly or upload a .yaml/.yml/.json file, which auto-switches the direction to match. Handles nested mappings and sequences, flow-style collections, comments (dropped only on the way to JSON, since JSON has no concept of them), and multi-line block scalars, using js-yaml, a widely-used YAML parser. Runs entirely client-side — nothing is uploaded.

About this tool

This tool converts between YAML and JSON, in both directions. JSON is a strict subset of what YAML can express, so YAML → JSON is a lossy-in-form but lossless-in-data translation: comments are dropped (JSON has no concept of them), but every value survives — mappings become objects, sequences become arrays, and YAML's flow style ({x: 1}), block style, and literal/folded block scalars (multi-line strings) are all parsed the same way regardless of which style was used to write them. Malformed YAML (an unclosed flow collection, bad indentation) is caught and reported with a clear error rather than silently producing wrong output. Going JSON → YAML, output uses YAML's more compact block style and disables line-wrapping, so long strings and arrays aren't awkwardly broken across lines. It runs entirely client-side using js-yaml, a widely-used YAML parser — nothing you paste or upload is ever sent anywhere.

What you can do

  • Convert YAML to JSON, or JSON back to YAML — both directions
  • Paste your data directly, or upload a .yaml/.yml/.json file
  • Handles nested mappings, sequences, comments, flow style, and block scalars
  • Copy the result or download it as a .json/.yaml file
  • Nothing is uploaded — every conversion happens locally in your browser

How to use

Step 1

Pick a direction

YAML → JSON or JSON → YAML — conversion happens instantly as you type, paste, or upload a file.

Step 2

Add your data

Paste it directly, or upload a .yaml/.yml/.json file — uploading auto-switches the direction to match the file.

Step 3

Copy or download

Copy the result, or download it as a real .json or .yaml file.

Example

This YAML:

YAML

name: Alice
address:
  city: NYC
tags:
  - a
  - b

JSON

{
  "name": "Alice",
  "address": {
    "city": "NYC"
  },
  "tags": ["a", "b"]
}

converts to that JSON and back — nested mappings become nested objects, and sequences become arrays.

How your data is handled

This tool is labeled 🟢 Browser: your YAML or JSON is parsed and converted directly in your browser using the js-yaml library — nothing is uploaded to a server, and nothing about it is retained once you leave the page.

Frequently asked questions

Do I lose anything converting YAML to JSON?+

Only comments — JSON has no way to represent them, so they're dropped. Every actual value (mappings, sequences, strings, numbers, booleans, null) survives exactly, regardless of whether the source YAML used block style, flow style, or block scalars.

Why does my multi-line string in YAML come back as one line with \n in it in the JSON?+

That's correct — a YAML literal block scalar (using |) represents a single multi-line string value. JSON has no native multi-line string syntax, so the same value is represented with escaped \n characters, which is exactly how it round-trips.

Can I upload a file instead of pasting?+

Yes — the file picker next to the input box accepts .yaml/.yml or .json depending on the current direction, and uploading a file automatically switches the direction to match it.

Why does it say my YAML is invalid?+

Usually an indentation mismatch or an unclosed flow-style collection ([ or { without its closing bracket). The error message includes the line where the parser got stuck, to help you find it.

Is my data uploaded anywhere?+

No — whether pasted or loaded from a file, conversion happens directly in your browser using the js-yaml library and the File API. Nothing here ever leaves your device.

Related tools