JSON/YAML Converter & Prettifier

Convert between JSON and YAML formats, prettify or minify your data

Privacy Notice: All conversions happen in your browser. Your data never leaves your device.

How to Use

  1. Paste JSON or YAML into the left panel
  2. Pick an action: JSON→YAML, YAML→JSON, Prettify, or Minify
  3. Choose indent style (2 spaces, 4 spaces, or tabs)
  4. Copy the output — everything runs locally, nothing leaves the tab

How This Compares to jq, yq, and js-yaml

This page uses js-yaml under the hood (the most popular YAML library on npm, ~40M downloads a week). js-yaml implements the YAML 1.1 Core schema by default, which is worth knowing because it changes results in surprising ways.

  • vs. jq: jq is JSON-only and built for querying and transforming, not format conversion. For pipelines (curl | jq '.items[]') jq is strictly better. Use this tool when you just want a prettified or minified result without learning jq's filter syntax.
  • vs. yq (Mike Farah's Go version): yq round-trips comments and preserves key order — this browser converter doesn't. If you're editing Kubernetes manifests and commit comments matter, use yq -i locally. If you just want a quick "is this valid and what does it look like as JSON?" check, stay here.
  • The YAML 1.1 gotcha: strings like on, off, yes, no, and No (as in "Norway") get parsed as booleans under the Core schema and become true/false in JSON. This is the infamous "Norway problem" — country code NO turns into false. Quote your strings: "NO". YAML 1.2 dropped these, but almost every library still defaults to 1.1 behavior.
  • Comments are lost going YAML → JSON because the JSON spec (RFC 8259) has no comment syntax. If your pipeline needs them, use JSON5 or JSONC (VS Code's variant) as a target instead.

My opinion after converting thousands of configs: use JSON for anything machines talk to machines about, YAML for anything a human will edit with intent, and keep a jq one-liner in your shell history for grep-style work.