dev101.io

JSON Formatter

Format, validate, and minify JSON in your browser — privately.

Loading tool…

How to use JSON Formatter

  1. Paste your JSON into the input panel on the left.
  2. Pick an indent style (2 spaces, 4 spaces, or tab) — the default is 2 spaces.
  3. Press the Format button (or ⌘/Ctrl + Enter) to pretty-print, or Minify to strip whitespace.
  4. Use Copy output to grab the result, or Share to generate a URL that restores your input.

JSON Formatter

A keyboard-driven JSON formatter, validator, and minifier that runs entirely in your browser. Paste in raw JSON, get a clean, indented, validated document back. Or do the reverse — minify pretty-printed JSON down to the smallest valid representation. Everything happens on your device; no payload ever leaves your browser.

Why another JSON formatter?

Most online JSON formatters do the work on a server. That makes them faster to build, but it also means every API response, every config file, and every error payload you paste into them gets logged somewhere you don't control. For anyone working with production data — JWTs, customer records, payment metadata — that's a non-starter.

The tool runs the parser entirely in your browser. The page ships with no JSON-handling endpoint. The validator, formatter, and minifier are all built on the standard JSON.parse / JSON.stringify primitives that ship with every modern browser, wrapped in a thin Result<T, E> interface so errors are typed instead of thrown. You get the same correctness guarantees as the V8 parser inside Node.js — because it is, literally, the same parser — without the round-trip.

What it does

  • Pretty-print with your choice of 2 spaces, 4 spaces, or tabs. Output is RFC 8259-compliant and round-trips through any standard parser.
  • Minify to the smallest valid representation. Useful for HTTP payload size budgeting, copy-paste into JSON columns, or saving config to a single line.
  • Validate as you type. The badge on the input panel turns green when the document parses, red when it doesn't, and the error includes a human-readable line/column reference where possible.
  • Strip BOM automatically. Files exported from Windows tooling or Excel often carry a leading UTF-8 byte order mark that breaks naive parsers; this tool detects and removes it before parsing.

Keyboard shortcuts

  • ⌘/Ctrl + Enter — Format
  • ⌘/Ctrl + Shift + M — Minify
  • ⌘/Ctrl + K — Open the global command palette (jump to another tool)

The shortcuts work even while focus is in the input textarea, because they include a modifier key.

Privacy promise

There is no analytics, no telemetry, no third-party script that touches your input. The optional Share button encodes a base64url snapshot of your input into the URL fragment (#s=…), which by HTTP design is never sent to any server. Sharing a link is a peer-to-peer transfer of state, not an upload.

What's not supported (yet)

  • JSON5 / JSONC: comments and trailing commas are rejected. A dedicated relaxed-parser tool is on the roadmap.
  • JSON Schema validation: this tool checks syntax, not shape. The forthcoming JSON Schema validator handles $ref, oneOf, and the rest.
  • Diff: see the JSON Diff tool for structural comparison between two documents.
  • Streaming: documents bigger than browser memory should be processed with a CLI like jq or a streaming parser like clarinet.

Frequently asked questions

Is the JSON I paste sent to your servers?

No. Every transformation runs locally in your browser. There is no JSON-handling endpoint on dev101.io — we deliberately avoid round-trips so your data, including secrets that might appear in payloads, never leaves your device. The "Share" button encodes state into the URL hash (the part after `#`), which is also never sent to a server by browsers.

Why does my JSON with comments or trailing commas fail to parse?

Strict JSON (RFC 8259) does not allow comments or trailing commas. If your input is JSON5, JSONC, or another superset, it will be rejected here. We chose strict mode so the formatter doubles as a validator — running it tells you whether the document will work in environments like `JSON.parse`, `jq`, or any standard parser. A dedicated JSON5/JSONC tool is on the roadmap.

How big a document can I format?

Anything that fits in browser memory. In practice, modern browsers handle multi-megabyte documents fine. The bottleneck is the textarea rendering, not the parser. If you're working with hundreds of MB, format in chunks or use a streaming CLI like `jq` instead.

Does the URL share link work for very large payloads?

It works up to roughly 50 KB of input — beyond that, browsers and servers may truncate or reject the URL. For larger payloads, use the "Copy output" button and paste the result wherever you need it.

Related tools