# Convert YAML to JSON

> Convert YAML to JSON online. Free YAML to JSON converter with a worked example and a live editor — runs entirely in your browser.

APIs and JavaScript code expect JSON, but the config you're working from is often YAML. This converter parses YAML and emits formatted JSON you can drop straight into a request body or a fetch call.

## Example: YAML → JSON

Input:
```
name: Devkult
stars: 1280
tags:
  - tools
  - dev
open_source: true
```

Output:
```
{
  "name": "Devkult",
  "stars": 1280,
  "tags": [
    "tools",
    "dev"
  ],
  "open_source": true
}
```

## How to convert YAML to JSON

1. Paste or type your YAML.
2. The converter parses the YAML structure.
3. It outputs the equivalent JSON, pretty-printed with two-space indentation.

## FAQ

### Will comments survive the conversion?

No. JSON has no comment syntax, so YAML comments are dropped. Only the data is converted.

### Does it handle nested YAML and lists?

Yes. Nested maps become nested JSON objects and YAML lists become JSON arrays, preserving the full structure.

## Related converters

- [JSON → YAML](https://www.devkult.com/convert/json-to-yaml.md)
- [CSV → JSON](https://www.devkult.com/convert/csv-to-json.md)
- [JSON → XML](https://www.devkult.com/convert/json-to-xml.md)

Open the interactive converter: https://www.devkult.com/convert/yaml-to-json