DEV Community

xiaochen11223
xiaochen11223

Posted on

How I built a privacy-first JSON formatter that runs 100% in the browser

A while ago I kept running into the same problem: I needed to format, validate and compare JSON payloads every day, but I didn't want to paste sensitive API responses into some random website. So I built JSONMini — a JSON toolkit that does everything in your browser. No uploads, no server, no data leaves your machine.

What it does

  • Minify & Beautify — with configurable indentation (2/3/4 spaces or tabs)
  • Validate — with error line/column highlighting so you know exactly where the JSON broke
  • Format — pretty-print with optional key sorting
  • Diff — side-by-side comparison of two JSON payloads
  • Viewer — tree view with image previews for URLs inside your JSON

The interesting part

Since everything runs client-side, there is no backend to worry about. The heavy lifting is done with the built-in JSON.parse/JSON.stringify plus a custom tokenizer for error positions, and the whole UI is a Next.js app deployed on Cloudflare Workers.

Two features I ended up loving:

  1. URL sharing — you can pass JSON via the ?json= query parameter, so sharing a payload with a colleague is as easy as sending a link.
  2. Local history — the last 10 payloads are kept in localStorage, so you can restore previous work without re-pasting.

Try it

It's free, no sign-up required: https://jsonmini.com

If you're building something similar, happy to answer questions in the comments!

Top comments (0)