sangsen

YAML to JSON

Convert a YAML document into formatted JSON, with adjustable indentation.

JSON output

Paste YAML into the input to convert it to JSON.

How it works

Paste YAML into the input box. It is parsed and re-serialized as JSON entirely in your browser via js-yaml — nothing is sent to a server — producing formatted JSON, or a clear error if the input is invalid or cannot map cleanly to JSON (for example multiple YAML documents in one input).

Example

Mapping with mixed types
name: Alice role: admin active: true{ "name": "Alice", "role": "admin", "active": true }

FAQ

Is my YAML uploaded anywhere?
No. Conversion happens in your browser via js-yaml — nothing you paste ever leaves your machine.
What happens if my YAML is invalid?
You get a plain description of what is wrong, and the line and column to look at, instead of an incorrect or partial JSON result.
Does it support multiple YAML documents in one input (separated by ---)?
No — multi-document YAML is rejected with a clear message. Provide a single document so the conversion is unambiguous.
What if my YAML contains something JSON cannot represent, like NaN or a circular reference?
It is rejected with a clear error rather than silently producing invalid or misleading JSON (for example, silently turning a non-finite number into null).