# YAML to JSON Converter

> Convert YAML to JSON or JSON to YAML instantly, both ways as you type. Line-numbered errors, multi-document YAML, copy and download. Runs in your browser.

Free online tool by ZemoPro. Open it at https://zemopro.com/tools/yaml-to-json (Developer tools). Runs in the browser; inputs stay on the device.

Paste YAML to get formatted JSON, or paste JSON to get clean YAML; the other side updates as you type. Use it for Kubernetes manifests, Docker Compose files, GitHub Actions workflows, OpenAPI specs and app config. Parsing follows YAML 1.2 and happens entirely in your browser, so private configuration never leaves your device.

## How to use it

Paste YAML on the left to get JSON on the right, or paste JSON on the right to get YAML. Errors show the line and column. Copy or download either side.

## Use cases

- Turn a Kubernetes or Docker Compose YAML file into JSON for an API, script or test fixture.
- Convert a JSON API response or package config into readable YAML.
- Find the exact line and column of a YAML indentation or syntax error.
- Check how YAML values such as yes, 1.0, null or dates are actually typed.

## Example

Input:

```
name: zemopro-site
version: 2
enabled: true
ports:
  - 80
  - 443
```

Result:

```
{
  "name": "zemopro-site",
  "version": 2,
  "enabled": true,
  "ports": [
    80,
    443
  ]
}
```

Numbers and true/false stay typed in JSON; text such as zemopro-site becomes a string. YAML comments are dropped because JSON has no comments.

## YAML 1.2 types, not YAML 1.1 surprises

The converter uses the YAML 1.2 core schema. Only true and false are booleans, so yes, no, on and off stay strings, which avoids the well-known “Norway problem” where NO became false under YAML 1.1. Values like 2026-12-04 stay strings rather than turning into dates. If a value must be text, quote it in YAML: "1.0" stays a string, while 1.0 becomes the number 1.

## What JSON can’t keep

JSON has no comments, anchors or multiple documents. Comments are removed, anchors and aliases (& and *) are expanded into full copies, and a file with several documents separated by --- becomes a JSON array with one item per document. .inf and .nan have no JSON equivalent and become null; the tool tells you when that happens. Duplicate keys in one mapping are reported as an error instead of silently keeping one value.

## Large IDs and conversion limits

Integer IDs outside JavaScript’s safe range become quoted JSON strings when converting YAML, with a notice, so no digits are silently lost. In JSON input, quote large integer IDs yourself before conversion; unsafe numeric values are rejected. Decimal values use JavaScript number precision. Mapping keys must be strings; unsupported YAML tags and complex keys are rejected rather than silently reinterpreted. Input and generated output are limited to 1,000,000 characters. Fix a syntax error before using the converted output; the outdated result is cleared.

## Private by design

Config files often contain hostnames, internal URLs or secrets. This converter runs entirely in your browser with the open-source yaml library; nothing you paste is sent to ZemoPro. Even so, remove real passwords and tokens before pasting configuration into any website.

## How YAML values become JSON

Results from this converter (YAML 1.2 core schema).

| YAML | JSON | Why |
| --- | --- | --- |
| `enabled: true` | `"enabled": true` | Boolean |
| `answer: yes` | `"answer": "yes"` | yes/no are strings in YAML 1.2 |
| `country: NO` | `"country": "NO"` | No “Norway problem” |
| `version: 1.0` | `"version": 1` | A number; quote it to keep 1.0 |
| `version: "1.0"` | `"version": "1.0"` | Quoted, so a string |
| `empty: ~` | `"empty": null` | ~ and null are null |
| `date: 2026-12-04` | `"date": "2026-12-04"` | Dates stay strings |
| `port: 0x1F` | `"port": 31` | Hexadecimal integer |

## Limitations

Uses YAML 1.2 (core schema) and runs on your device; nothing is uploaded. Comments, anchors and key order styling are not kept in JSON. Several YAML documents become a JSON array; .inf and .nan become null. Inputs up to 1,000,000 characters.

## FAQ

### Is my YAML uploaded?

No. Conversion runs in your browser; the text you paste isn’t sent to ZemoPro’s server.

### Why did my YAML comments disappear?

JSON has no comment syntax, so comments can’t be carried over. Keep the YAML file as your source if you need them.

### Can it convert a file with several documents?

Yes. Documents separated by --- become a JSON array, in order.

### Why is yes a string and not true?

In YAML 1.2, only true and false are booleans. Older YAML 1.1 parsers treated yes, no, on and off as booleans; this converter follows 1.2.

### How do I convert JSON to YAML?

Paste the JSON into the right-hand box. The YAML appears on the left, ready to copy or download as a .yaml file.

## Related tools

- [Format and validate JSON](https://zemopro.com/tools/json-formatter)
- [Encode or decode Base64](https://zemopro.com/tools/base64-encoder-decoder)
- [Test a regular expression](https://zemopro.com/tools/regex-tester)

---

About ZemoPro: ZemoPro (zemopro.com) is a free collection of 111 online tools for images, PDFs, text, code, SEO, websites and social media, plus practical guides. No account or sign-up is needed. 95 of the 111 tools run entirely in the browser, so files and text stay on the user’s device. Remote tools send the submitted address and, in supported paste modes, the pasted HTML, XML or text to ZemoPro’s server for analysis. Public URL fetches use private-network protections. Check each tool’s processing notice before submitting sensitive information. Each tool page explains its limits honestly; ZemoPro does not promise rankings, traffic or results.
