Skip to content
Developer tools

JSON Formatter & Validator

Pretty-print, minify and validate JSON with precise error positions.

Options

Everything above is processed in this browser tab. Your input is never sent to a server.

What is JSON Formatter & Validator?

JSON Formatter & Validator parses a JSON string, reports syntax errors with their character position, and re-serialises the data either indented for reading or minified for transport. It is used to make an API response legible, to check a config file before deploying, and to shrink payloads.

How to use it

  1. 1Paste raw JSON — minified, escaped or hand-edited.
  2. 2Choose pretty-print or minify and set the indent width.
  3. 3If the JSON is invalid, the error message names the position of the first problem.
  4. 4Copy the formatted output back into your editor or request body.

Features

  • Strict JSON parsing with human-readable error positions
  • Configurable indentation from one to eight spaces
  • Optional alphabetical key sorting for stable diffs between environments
  • Minify mode strips all insignificant whitespace

When people use it

Debugging an API response

A minified response in a network tab is unreadable. Pretty-printing reveals nesting depth and makes a missing field obvious.

Stabilising config diffs

Sorting keys before committing means version control shows real changes rather than reordering noise.

Validating before deploy

A trailing comma in a config file can break a deployment. Validating locally catches it in seconds.

Known limits

  • Strict JSON only: comments, trailing commas and single-quoted strings are rejected by design, matching JSON.parse.

JSON Formatter & Validator questions

Related tools

Hand-picked hubs, guides and companion tools related to this page.

Last reviewed 2026-08-08. Browse the full directory.