UtilInUse

Guides

Format JSON without leaving the browser

Pretty-print, validate, and minify JSON in the tab. Catch trailing commas early and keep staging secrets off remote servers.

Maya Okonkwo · Jun 16, 2026 · 7 min read

JSON shows up everywhere: API responses, config files, clipboard dumps from a debugger. When it arrives as a single compressed line, the first job is usually the same — make it readable, then decide whether it is even valid.

You do not need a server for that. JavaScript’s JSON.parse and JSON.stringify already run in the tab you have open. UtilInUse’s JSON tools wrap those primitives in a calmer interface: indent, compact, and report the first syntax error without a round-trip.

Start with validity, not aesthetics

Pretty-printing a broken document can hide the real problem. Validate first when the payload came from an unfamiliar source. A trailing comma, an unquoted key, or a truncated object will fail parse immediately. Fix that, then format.

Useful habit:

  1. Paste the raw payload
  2. Validate
  3. Format with a consistent indent
  4. Copy only what you need downstream

If you are hand-building a request body, minify as a last step so the editor stays readable while you edit.

Keep secrets in the tab

Staging credentials, session cookies, and infrastructure dumps routinely appear inside JSON. Shipping that blob to a remote “formatter” creates a copy you did not plan for. Local formatting keeps the document in page memory. Close the tab when you are done.

See the JSON formatter, validator, and minifier for the day-to-day loop.

Indentation and diffs

Pick one indent width for a project and stick to it. Two spaces are common in web APIs; four spaces still appear in older configs. Consistent formatting makes git diffs smaller and review comments more useful.

When two versions disagree, a local diff checker is often enough. You do not need to upload either side to see what changed.

Escaping and unescaping

Sometimes the problem is not structure — it is that a string was escaped twice, or you need to embed text inside a JSON string. Escape and unescape helpers belong next to the formatter so you can fix payloads without bouncing through a separate site.

A short workflow that scales

  • Incoming mystery payload → validate → format → inspect
  • Outgoing request body → edit formatted → minify → send
  • Log fragment with escapes → unescape → format → read

That is most of the JSON work people do between coffee and standup. Keep it local, keep it fast, and leave the upload form alone.