SomeeLab.tools

JSON Formatter & Validator

Format, minify and validate JSON. Broken JSON is pinned to the exact line. Free, no signup, runs in your browser.

Finding where it broke

When a paste fails to parse, you get the line and column where the parser gave up. Look one line above that first. A missing or extra comma is only noticed at the next token, so the reported position is usually just after the real mistake.

The usual suspects are a short list.

  • A trailing comma after the last item. Legal in JavaScript objects, an error in JSON.
  • Single quotes. 'name' is not a JSON string. Both keys and values take double quotes.
  • Comments. A config file with // or /* */ is JSONC, not JSON.
  • Unquoted keys. {name: "value"} is JavaScript syntax.
  • NaN and Infinity. They look numeric but are not in the JSON spec. They usually arrive by way of a log copy-paste.

When to minify

Minifying strips every optional space and puts the document on one line. That is the shape you need to paste into a config value, squeeze into a single environment variable, or send as a curl body. It also shrinks the file, though servers gzip responses anyway, so size alone is rarely the reason.

For anything that lands in a repository, keep the indentation. A minified file turns a one-character change into a whole-file diff, and nobody can review that.

Key order and whitespace

Formatting keeps your keys in their original order. The spec says object key order carries no meaning, but in practice almost every parser preserves insertion order, so this tool leaves it alone.

Two spaces is the most common indent; four shows up alongside Python tooling. Tabs save a few bytes but render at different widths depending on the editor. In a shared repository, match whatever is already there.

Pasting tokens and real response bodies

Nothing you paste is sent anywhere. The text is parsed and re-serialised inside your browser, so a response full of customer data or a bearer token never leaves the machine. Company policy sometimes bars external tools regardless of how they work, so check that first if the data is from production.