Skip to content
UtilDock

JSON Formatter

Pretty-print an unreadable response, or minify it · runs in this tab, never sent anywhere

Input

0 BPaste or drop JSON to begin

Formatted

0 B

How the JSON Formatter works

A JSON formatter and minifier in one. Pretty-print with two, three or four spaces or tabs, compact the document back to a single line, or sort every object’s keys alphabetically so two files diff cleanly in version control. The result updates as you type, and the document is never uploaded.

Paste or drop a document into the input panel and the formatted result appears as you type. Choose two, three or four spaces, or tabs — whichever your project uses. Switch to Minify to strip every byte of whitespace, which is what you want before embedding JSON in an environment variable or a URL.

Sort keys rewrites every object with its keys in alphabetical order. Two documents that differ only in key order become byte-identical, which makes them diff cleanly in version control.

Parsing runs in a Web Worker, so even multi-megabyte documents format without the page going unresponsive while you type.

Common questions

What is the difference between formatting and minifying JSON?

Formatting adds indentation and line breaks so the structure is readable. Minifying strips every byte of optional whitespace, which is what you want before putting JSON in an environment variable, a URL or over the wire. Both produce the same data.

Why would I sort the keys?

Two documents that describe the same thing but list their keys in a different order produce a noisy text diff. Sorting keys alphabetically makes them byte-identical where they agree, so only real changes appear in version control.

Can it handle very large files?

Yes. Parsing and formatting run in a Web Worker, so multi-megabyte documents reformat without the page going unresponsive while you type.

Is my JSON uploaded to a server?

Never. The formatter is JavaScript running in your own tab and there is no backend to send anything to. It keeps working with the network disconnected.