Your files stay on your device

# Convert JSON

Convert JSON to and from YAML, TOML, CSV, XML, NDJSON, query strings, .env, MessagePack, CBOR, and BSON. Numbers keep their exact value, and every mapping rule and loss is shown before and after the conversion.
JSONCJSON5HJSONplistYAMLTOMLCSVXMLNDJSONQuery string.envMessagePackCBORBSONInsert JSON sampleClear

Every conversion runs through one shared model: **JSON → YAML**. The rules below always apply: nothing converts until you have seen them.
Back to YAML → JSONJSONC input (comments + trailing commas)

Strict JSON (RFC 8259)
Paste, drop, or type to begin. Everything stays on this device.

## How JSON → YAML maps

### Reading JSON

- Strict JSON (RFC 8259) by default; the JSONC option also accepts comments and trailing commas and reports both as dropped.
- Numbers keep their exact spelling: 1e400, 30-digit integers, 1.50, -0 travel to the target format verbatim.
- Duplicate object keys: the LAST value wins and every duplicate is reported (first position keeps its place).

### Writing YAML

- 2-space block style, 100-column line width; strings that look like numbers or booleans are quoted so they cannot re-parse as something else.
- Numbers emit their exact lexeme; object key order follows the source.
- Dates (arriving from TOML) become plain ISO strings; YAML core has no date type.
- Binary payloads (arriving from MessagePack/CBOR/BSON) become lowercase hex strings; MessagePack extensions keep their payload hex; CBOR tags keep their inner value, each with a loss note.

JSON capabilities

- comments : no
- duplicateKeys : yes
- bigIntegers : yes
- dates : no
- binary : no
- orderedMappings : yes

## More JSON tools

- [JSON formatter](/json/formatter)
- [JSON validator](/json/validator)
- [JSON diff](/json/diff)
[All JSON tools](/json)

---

Canonical HTML: https://nutter.tools/json/convert/
Markdown version: https://nutter.tools/json/convert/index.md
Plain-text version: https://nutter.tools/json/convert/index.txt
Agent index: https://nutter.tools/llms.txt

