YAML runs the modern infrastructure world: Kubernetes manifests, CI pipelines, Docker Compose files and application configs are all YAML, because humans find it easy to read and write. JSON runs the API world, and sooner or later a YAML document needs to become JSON: to feed an API, to store in a database, or to check what a config actually parses into. This converter handles the everyday shape of YAML: nested maps by indentation, lists with dashes, quoted and plain strings, numbers, booleans and nulls, and returns tidy indented JSON you can copy straight into your project.
Quick Answer: Paste your YAML on the left and click Convert. Nested maps, lists, numbers, booleans and null values are converted with their types preserved, and the JSON appears indented on the right with any problem line reported.
How to Use the YAML to JSON Converter
- Paste the YAML document into the input box.
- Click Convert to JSON.
- Review the output: indentation shows the structure, and numbers, booleans and nulls appear unquoted.
- If an error names a line, check it for tab characters or inconsistent indentation, the two classic YAML faults.
- Copy the JSON, or download it as a .json file.
Key Features
- Indentation-based nested maps converted to any depth, matching how real config files are written.
- Lists supported in both block style (dash lines) and lists of maps, the shape Kubernetes and CI files use.
- Automatic scalar typing: integers, decimals, true/false and null are recognised; quoted values stay strings.
- Comments are ignored, as YAML specifies, so documented configs convert cleanly.
- Line-specific error reporting for tabs and malformed lines instead of a silent empty result.
Best Practices and Tips
- Convert a config before deploying it to see exactly what the parser sees; most YAML surprises are indentation you cannot spot by eye.
- Quote version numbers like “1.20” in YAML if they must stay strings, because YAML reads them as numbers otherwise.
- Watch for unquoted strings containing a colon followed by a space; YAML treats that as a nested map and your JSON will show it.
- Keep the JSON output when migrating a config format: it doubles as a structural diff against the next version.
Common Mistakes to Avoid
- Using tab characters for indentation: YAML forbids them, and mixed tabs are the number one cause of conversion errors.
- Assuming every YAML feature is supported everywhere: anchors and multi-line block scalars are advanced features; this converter covers the common config subset.
- Forgetting that plain yes/no/on/off can parse as booleans in YAML 1.1 tools, which surprises people in country codes and feature flags.
- Pasting several YAML documents separated by — and expecting one JSON object; convert each document separately.
Frequently Asked Questions
Which YAML does this converter support?
The everyday subset used by configuration files: nested key-value maps by indentation, block lists, lists of maps, inline scalars (strings, numbers, booleans, null) and comments. Exotic features such as anchors, tags and multi-document streams are outside its scope.
Why did my number become a string, or the reverse?
YAML decides types from how a value is written. A value in quotes is always a string. An unquoted value that looks like a number, boolean or null is converted to that JSON type, which is exactly what a real YAML parser would produce.
What does the error ‘tabs are not allowed’ mean?
Your document contains a tab character in the indentation. YAML requires spaces. Most editors can convert tabs to spaces for the file; after that the same document converts cleanly.
Can it convert JSON back to YAML?
This tool is one-directional. For the reverse trip, the JSON to XML Converter covers structured output in another format, and dedicated YAML writers exist in most programming languages’ standard tooling.
Is my configuration uploaded?
No. The parser runs in your browser. Production configs, which often contain hostnames and internal structure, never leave your device.
Related Tools