YAML to JSON Converter
Convert YAML to JSON online. Parses nested mappings, sequences, flow collections and typed scalars, and flags tabs, duplicate keys and unsupported features. Runs in your browser.
What was produced
Import from File
Drag & drop a file here
or
Supports .txt, .csv, .log, .json and other text files
All conversion happens locally in your browser. No data is sent to any server. Your YAML stays completely private.
What It Does
This tool reads YAML — the indentation-based format behind Kubernetes, Docker Compose, GitHub Actions, and countless config files — and converts it to clean, pretty-printed JSON that code and APIs can consume directly. It understands the parts of YAML people actually use every day: nested mappings and sequences, plain and quoted strings, real booleans, numbers and nulls, inline flow collections like [1, 2, 3], comments, and the --- document marker. Just as importantly, it watches for the things that quietly break YAML: a tab used for indentation, a duplicate key that will overwrite an earlier one, or advanced features like anchors and multiple documents that a simple conversion can't fully honour. Instead of failing with a cryptic message or dropping data silently, it converts what it can and clearly reports anything you should double-check.
When to Use It
- You have a YAML config (Compose, Kubernetes, CI, Ansible) and need it as JSON to feed a script, API, or tool that only speaks JSON.
- You're debugging why a YAML file won't parse and want a converter that pinpoints tabs, duplicate keys, or unsupported syntax.
- You want to confirm how YAML's loose typing (yes, no, null, numbers) maps to strict JSON types before relying on it.
- You're moving settings from a YAML-based system to a JSON-based one and need a faithful, ready-to-paste conversion.
Worked Examples
name: web
replicas: 3
ports:
- 80
- 443
Basic mapping with a block sequence. replicas becomes the JSON number 3 and ports becomes a JSON array [80, 443].
service:
enabled: true
region: us-east-1
tags: [prod, web]
Nested mapping plus an inline flow sequence. enabled becomes a real boolean, and the flow list [prod, web] is parsed into a JSON array of strings.
country: "no"
active: yes
zip: 007
Shows YAML typing: the quoted "no" stays the string "no", the unquoted yes becomes the boolean true, and unquoted 007 is kept as a string to protect its leading zero.
Features
How to Use
1. Paste or upload YAML in the input area. 2. The JSON appears instantly, pretty-printed. 3. Check the insights panel for the structure summary and any warnings (tabs, duplicate keys, unsupported syntax). 4. Click Copy or Download to save the result.
Common Mistakes
- Indenting with tabs. YAML only allows spaces for indentation; a tab is a common reason a file refuses to parse. The tool flags tabs so you can replace them.
- Relying on duplicate keys. If the same key appears twice in a mapping, the last value wins and the first is lost — the tool warns you so you can catch the mistake.
- Expecting anchors, aliases, or multiple documents to be merged. Those aren't fully supported; the tool converts the first document and tells you when it skipped advanced syntax.
- Forgetting that unquoted yes/no/on/off become booleans. If you need the literal word, quote it in the YAML — otherwise it converts to true or false.