🔄 JSON to YAML / YAML to JSON Converter

Convert between JSON and YAML formats bidirectionally with indentation control and real-time statistics.

Last updated: November 8, 2026 · By the BoltQuickTools team

|

Moving data between JSON and YAML without retyping it

An API hands you JSON but the deployment file wants YAML, or a script only reads JSON and your settings live in a YAML file. Rewriting the structure by hand is slow, and one wrong indent changes the meaning. This page converts in either direction, and it handles straightforward config well. Read the limits below before trusting it with a complicated YAML file.

Running a conversion

  1. Paste into the JSON panel or the YAML panel. The buttons Simple, Nested, Arrays and Complex load a sample into the JSON panel and convert it straight away.
  2. Pick 2 spaces or 4 spaces in the Indent dropdown. It applies to the output of either direction.
  3. Click JSON ➔ YAML or YAML ➔ JSON. Nothing converts until you click. The result replaces the content of the other panel.
  4. Use Copy JSON, Copy YAML or Clear. Line and character counts sit above each panel.

Two conversions, with the real output

JSON to YAML, with 2-space indent:

{"server":{"host":"localhost","port":8080,"tls":true},"tags":["api","v2"],"url":"https://example.com","retries":"3","note":null}

produces:

server:
  host: localhost
  port: 8080
  tls: true
tags:
  - api
  - v2
url: "https://example.com"
retries: "3"
note: null

The string "3" keeps its quotes so it stays a string. The URL is quoted because it contains a colon. Keys that open a nested block carry a trailing space, which YAML parsers ignore.

YAML to JSON shows how plain values get typed:

# service config
name: web
port: 8080
enabled: yes
version: 1.20
country: NO
tags: [a, b]

produces:

{
  "name": "web",
  "port": 8080,
  "enabled": true,
  "version": 1.2,
  "country": false,
  "tags": [
    "a",
    "b"
  ]
}

The comment is gone, yes became true, NO became false, and 1.20 became the number 1.2. Quote those values in the YAML if you need them kept as text.

YAML this parser gets wrong

The YAML side is a small hand-written parser, not a full implementation. Some input produces an error, but several cases give incomplete output with no warning, so compare the result against your source.

In the other direction, a string containing line breaks is written as a | block, which gains a trailing newline when converted back. A bare top-level JSON string with a line break comes out as just |, losing its content.

For checking that JSON is valid, the JSON formatter is a better fit. If your target is TOML or INI, use the TOML converter. The article on YAML, TOML and JSON5 covers how the formats differ.

Common questions about this converter

Can I paste a Kubernetes manifest?

Only after adjusting it. Remove any --- line and make sure lists are indented under their parent key. Output from kubectl get -o yaml commonly places lists at the same column as the key, and those lists are dropped.

Are my comments kept if I convert to JSON and back?

No. JSON has nowhere to store them, so they are discarded on the first conversion.

Does the config I paste get uploaded?

The conversion functions in this page make no network calls. The page does load analytics, plus ads if you accept them, so treat live secrets with your usual care.