Skip to content
Plaintools

YAML to JSON converter

Paste YAML or flip the toggle to start from JSON. Conversion runs through js-yaml in the page. Use this to clean config, then send the JSON to the CSV converter if you need a spreadsheet.

YAML → JSON

Want a spreadsheet? Convert to JSON, then use the JSON to CSV converter.

YAML to JSON converter example

A small service config

name: checkout\nreplicas: 3\nports: [80, 443] becomes a JSON object with a ports array. Toggle reverse to get YAML back.

YAML to JSON converter how-to

  1. YAML→JSON: trim; js-yaml `load(trimmed)`; return JSON.stringify(value, null, 2) + newline. Default schema: maps, lists, numbers, booleans, null. Custom tags may fail.
  2. JSON→YAML: trim; JSON.parse; js-yaml `dump(value, { lineWidth: 80, noRefs: true })`. Comments are not restored.

Related tools

Dev

JWT decoder

Read a JWT header and payload, with human timestamps and an expired flag. The token stays in the tab.

Dev

Text diff checker

Compare two texts with a live line and word diff. Optional ignore-whitespace.

Dev

CSV to JSON converter

Convert CSV records to a JSON array of objects with header mapping and type detection.

People also use

Dev

Hash generator

Calculate SHA-256, SHA-384, SHA-512, and SHA-1 checksums for text or local files.

Dev

Timestamp converter

Convert Unix epoch timestamps in seconds or milliseconds to ISO 8601, UTC, and local time.

Dev

Subnet calculator

Calculate IPv4 network address, broadcast, usable range, subnet mask, and host capacity from CIDR.

Dev

CIDR calculator

Calculate IPv4 CIDR blocks, network address, broadcast address, netmask, usable hosts, and wildcard mask.

YAML to JSON converter FAQ

Is my YAML uploaded?
No. js-yaml runs in this tab. YAML and JSON never leave the browser; there is no upload.
Does this resolve YAML anchors and aliases?
Yes. js-yaml resolves `&anchors` and `*aliases` into concrete JSON values in this tab. JSON has no reference syntax, so each alias becomes a full copy. Multi-document streams separated by `---` are not supported — paste one document at a time.
Which YAML features are supported?
js-yaml’s default schema: maps, lists, numbers, booleans, null, and most literals you see in app config. Custom tags and some multi-document tricks may fail; the error banner will say so.
Does reverse mode keep comments?
No. JSON has no comments, and dumping YAML from the parsed value cannot restore the original comment text or key order guarantees beyond what the parser kept.
Can I convert a file from disk?
Open it in an editor and paste the text. There is no file-upload API on purpose. Very large documents may be slow in the tab; this is meant for configs and snippets, not multi-megabyte dumps.
How do I get CSV from YAML?
Convert YAML to JSON here, confirm you have an array of objects, then use the JSON to CSV converter. Both tools stay on-device.
How do I convert YAML and JSON the same way?
YAML→JSON: js-yaml load(), then JSON.stringify(value, null, 2) plus a newline. JSON→YAML: JSON.parse, then js-yaml dump(value, { lineWidth: 80, noRefs: true }). Comments and original key order are not restored. Custom YAML tags may fail.