Dev-Utilities logoDev-UtilitiesAbout

JSON / YAML Formatter & Diff

Format, validate, and convert JSON and YAML. Switch to diff mode to compare two documents side-by-side and highlight changes.

Output will appear here...

About the JSON / YAML Formatter

This tool lets you paste raw or minified JSON or YAML and instantly see it formatted with consistent indentation and syntax. It also validates the input and reports parse errors so you can quickly identify malformed documents. All processing happens in your browser — nothing is sent to a server.

Format mode

Paste any JSON or YAML into the input panel. The formatter automatically detects which format you have pasted, parses it, and outputs it in the format you select — either JSON or YAML — with your chosen indent width (2 or 4 spaces). If the input is invalid, a clear error message is shown in the output panel with the line and position of the first parse error.

JSON ↔ YAML conversion

Because the formatter normalises both formats through the same internal data model, you can use it as a lossless converter: paste JSON and select YAML output to get an equivalent YAML document, or vice versa. String keys, nested objects, arrays, numbers, booleans, and nulls are all preserved exactly.

Diff mode

Switch to diff mode to compare two JSON or YAML documents. Both inputs are normalised to formatted JSON before diffing, so cosmetic differences (whitespace, key order, YAML vs JSON syntax) are ignored and only structural changes are shown. Added lines are highlighted in green, removed lines in red, and unchanged lines are shown in grey.

Common use cases

  • Formatting a minified API response or config file for readability
  • Validating a JSON or YAML file before committing it to source control
  • Converting a JSON config to YAML (or back) for a tool that only accepts one format
  • Comparing two versions of a configuration file to find what changed
  • Quickly identifying a syntax error in a Kubernetes manifest or CI pipeline file

Privacy

This tool runs entirely in your browser. Your JSON and YAML data are never transmitted to any server. Learn more about how Dev-Utilities handles privacy.