Skip to main content
SlapMyWeb
Skip to tool
Developer

YAML to JSON

Convert YAML configuration to JSON format. Handles key-value pairs, nested objects, arrays, and common YAML types.

Click Convert or press Ctrl+Enter...
Handles basic YAML: maps, sequences, scalars, inline syntax

What is YAML to JSON Converter?

YAML to JSON is a developer tool that converts YAML (YAML Ain't Markup Language) data into JSON (JavaScript Object Notation) format. YAML is popular in DevOps config files (Docker Compose, Kubernetes manifests, GitHub Actions workflows), and sometimes you need the equivalent JSON for APIs, scripts, or tools that only accept JSON. This converter handles key-value pairs, nested maps, sequences (arrays), inline syntax, and common YAML scalar types like booleans, numbers, and null.

How to Use YAML to JSON Converter

  1. 1

    Paste your YAML

    Enter or paste YAML content into the left text area. Click Load Example for a sample.

  2. 2

    Click Convert

    Press the Convert button or Ctrl+Enter to transform YAML to JSON.

  3. 3

    Review the JSON

    The formatted JSON output appears in the right panel with proper indentation.

  4. 4

    Copy the result

    Click Copy to copy the JSON to your clipboard.

Features

  • Converts YAML maps to JSON objects
  • Converts YAML sequences to JSON arrays
  • Handles nested structures with any depth
  • Parses YAML booleans (true/false/yes/no), numbers, and null
  • Supports inline arrays [a, b] and objects {a: b}
  • Skips comments and blank lines
  • Pretty-printed JSON output with 2-space indent
  • 100% client-side — no data leaves your browser

Related Tools

Frequently Asked Questions

What YAML features are supported?+
This tool handles the most common YAML features: key-value maps, sequences (arrays), nested structures via indentation, inline arrays/objects, quoted strings, booleans, numbers, and null. Advanced features like anchors, aliases, and multi-line block scalars are not supported.
Why did my complex YAML fail to parse?+
This is a lightweight browser-based parser designed for common YAML patterns. For complex YAML with anchors (&/<<), multi-line blocks (|/>), or merge keys, use a full YAML parser like js-yaml.
Does it handle YAML comments?+
Yes, lines starting with # are treated as comments and are skipped during parsing. JSON does not support comments, so they are dropped in the output.
Can I convert JSON back to YAML?+
Yes, use our JSON to YAML converter at /tools/json-to-yaml for the reverse conversion.
What indentation does the YAML parser expect?+
The parser uses 2-space indentation, which is the most common YAML convention. Other indentation levels should also work as long as they are consistent.
Does it handle YAML with tabs?+
YAML specification forbids tabs for indentation. If your YAML uses tabs, the parser may produce unexpected results. Convert tabs to spaces first.
Is there a file size limit?+
No hard limit. The tool runs entirely in your browser. For very large YAML files (over 1MB), parsing may take a moment depending on your device.
Are boolean values like yes/no converted correctly?+
Yes. YAML treats yes/on/true as true and no/off/false as false. These are converted to JSON boolean true/false accordingly.