🛠️Dev Toolbox

📋 JSON Formatter / Validator

Format, validate, minify, and transform JSON with syntax highlighting, path queries, and schema inference.

JSON formatting seems simple until you're staring at a 4 KB single-line payload from some internal service and trying to find which key in nested-object-number-seven is null. Then you need a formatter.

Paste JSON, get pretty output. That's the basic flow. Tab size configurable to 2 or 4 spaces. Pick your poison — there's genuinely no universal "right" answer; it's a team convention thing.

But the real value isn't pretty-printing. It's validation. Every dev has gotten a "Unexpected token at position 1847" runtime error from some JSON.parse call. You scroll to position 1847 in a one-line string. It's maddening. This tool highlights the error location inline with a line number and column position, so you don't have to count characters. If your JSON payload is valid, you'll see the green checkmark instantly. If not, you'll see exactly where and why.

Trailing commas are the #1 syntax error I see in hand-edited JSON. Trailing comma after the last item in an object or array. Looks fine to a human, fails spec-compliant parsers instantly. Older IE-era JavaScript engines choked on these; modern ones mostly accept them as a non-standard extension. But Node.js and Chrome's built-in JSON.parse? Strict. No trailing commas. The formatter flags these before you copy the output.

Numbers beyond 2^53 - 1 are a landmine. JavaScript's Number type loses precision above that — your 16-digit database primary key becomes a rounded integer and you've got a data integrity bug that takes six months to find. The validator warns on suspiciously large numbers. Use BigInt serialization (string-quoted) or the tool's large-number mode if you're dealing with IDs.

The Schema inference tab takes one example JSON and spits out a JSON Schema draft. Not always perfect (it can't always guess string patterns or min/max constraints from one sample), but it's a starting point for generating your API contract. Handy when you're reverse-engineering a third-party API response shape.

The Tree view collapses deeply nested objects without losing context. The Diff mode is good for code review: paste request on left, response on right, see exactly what mutated. Did the server add a field you didn't expect? Is there a date being returned as a string when you thought it was a number? The diff makes it visible.

Minification output strips whitespace for wire transport. 30-40% size reduction on typical payloads. Use it when generating fixtures for tests or when you're building responses for constrained clients.

More Developer Tools

Explore our complete collection of 60+ free developer tools at dev.aisoosoo.com. All tools run 100% in your browser — no signup, no data sent to servers.