Skip to content
epitometool

JSON formatter

JSON & data

Beautify, minify and validate JSON instantly.

Updated

Options

Indent:

Input JSON

Formatted

  • EnterCopy output
  • KClear input

Quick start

How to format and validate JSON

Paste JSON, pick an indent style, copy the formatted output. Errors point to the exact line + column.

  1. Step 1
    Paste your JSON

    Drop API responses, config files or any JSON snippet into the editor. Enable 'Fix common mistakes' if your source has trailing commas, single quotes or comments.

  2. Step 2
    Pick an indent style

    Choose 2 spaces, 4 spaces, tab indentation, or Minify to strip every optional space for production payloads.

  3. Step 3
    Copy or read the error

    Hit Copy or press ⌘/Ctrl+Enter to grab the formatted output. If parsing fails, the error panel shows the exact line, column and a caret-pointed excerpt.

In-depth guide

JSON formatter, validator and minifier

Beautify, minify and validate JSON in the browser. Errors show the exact line, column and a caret-pointed excerpt so you can spot the broken comma without scrolling. The "Fix common mistakes" toggle turns almost-JSON (trailing commas, single quotes, JS comments) into the real thing.

JSON in 60 seconds

JSON (JavaScript Object Notation) is a strict text format derived from a subset of JavaScript object syntax. Six value types: string, number, boolean, null, array, object. Strings are always double-quoted; keys must be strings; no trailing commas; no comments.

It became the default API wire format because it's human-readable, language-agnostic and every modern runtime parses it natively.

Indent styles and when to pick which

  • 2 spaces — defaults for npm, prettier, GitHub Actions. Most compact while staying readable.
  • 4 spaces — Python's tradition; AWS / Kubernetes config files often follow it.
  • Tab — preserves user-configured tab width and saves bytes vs spaces.
  • Minify — strips every optional space. Use for production API responses and config files shipped over the network.

What 'Fix common mistakes' rewrites

The transforms are textual, not parser-aware. Apostrophes inside single-quoted strings, URLs containing // outside strings, or keys that happen to be reserved words can confuse the cleanup. Always re-check the output before saving over the original file.

Toggle the option to enable a best-effort pre-processor that handles the four most common reasons strict JSON.parse rejects almost-JSON:

  1. Trailing commas after the last item in an array or object — silently removed.
  2. Single quotes around strings — converted to double quotes.
  3. Unquoted object keys ({ name: "x" }) — keys get wrapped in quotes.
  4. JS-style comments (// and /* */) — stripped entirely.

Reading error messages

When the parser fails, we surface three pieces of info:

  • The raw browser message — V8 and SpiderMonkey describe the same error differently; Chrome says "Unexpected token X", Firefox says "expected double-quoted property name".
  • Line and column derived from the position the engine reports.
  • A caret-pointed excerpt of the offending line so you can spot the issue at a glance.

The most common causes: missing comma between properties, missing closing brace, unescaped double quote inside a string. The structure tile (Depth / Keys / Arrays …) only appears on successful parse — use it as a sanity check that the data shape matches what you expect.

Frequently asked questions

Does my JSON get sent to a server?

No. Parsing, formatting and validation all run in your browser via the built-in JSON.parse / JSON.stringify functions. Open DevTools → Network during use — you'll see zero requests.

What does 'Fix common mistakes' actually fix?

Trailing commas before `}` or `]`, single-quoted strings, unquoted object keys, and `//` line + `/* */` block comments. These transforms are best-effort and lossy in edge cases — use them for permissive paste-and-go, not for production data.

Why is my line/column number off by one in some browsers?

Each browser's JSON.parse reports errors slightly differently. We extract the position from V8's 'at position N' and Firefox's 'line N column M' messages; if neither pattern matches, we show the raw error without coordinates.

How large a payload can it handle?

Modern browsers can parse JSON in the 100-500 MB range, but the textarea UI becomes sluggish well before that. For multi-megabyte payloads use a code editor with virtualised rendering — this tool is tuned for normal API responses (typically under a few MB).

Does it preserve property order?

Yes — ECMA-262 guarantees integer-keyed properties come first in numeric order, then string-keyed properties in insertion order. JSON.stringify follows the same rules, so what you see in the output matches what runtime code would iterate.

Can it handle JSON with comments (JSONC)?

Enable 'Fix common mistakes' — `//` and `/* */` comments get stripped before parsing. Note the JSON spec itself forbids comments; the cleaned output won't contain them.

Keep exploring

More tools you'll like

Hand-picked utilities that pair well with the one you're on — all free, client-side, and zero-signup.