Format
Rewrites the whitespace between values with your indent, one value per line, and changes nothing else.
Paste JSON to pretty-print it with the indent you like, minify it, or check it and see exactly where the first mistake is. Everything runs in your browser, nothing is uploaded, and keys stay in their original order unless you ask to sort them.
The formatter works on the text itself rather than through JSON.parse, so a number written as 1.0 stays 1.0, escapes stay escapes, and keys move only when you ask.
Rewrites the whitespace between values with your indent, one value per line, and changes nothing else.
Removes every space, tab and line break outside strings: the smallest text that still parses to the same value.
Orders the keys of every object by character code, at every depth, then formats. Arrays keep their order.
Checks the whole document and reports the first problem with its line, its column and an excerpt of that line.
Built by Mohd Shayan. Found a problem or have an idea? Send a note.
No. Formatting, minifying, sorting and validation run in your browser with plain JavaScript, and the page makes no network request with your text. Nothing is stored either: the box is empty again when you come back. That is also why a 5 MB document is fine: there is no upload to wait for, only the work your own device does when you press a button. A result longer than 200,000 characters is shown in part, to keep the page quick, while Copy and Download always use the whole result.
Only the whitespace between values. The formatter works on the text itself rather than through JSON.parse, so numbers stay exactly as written (1.0 stays 1.0 and 1e400 is not turned into null), unicode escapes stay escapes, keys keep their original order and even duplicate keys survive. Minify removes every space, tab and line break outside strings and nothing else.
It depends on how much whitespace the document carries. The example on this page is 269 bytes as pasted and 221 bytes minified, a saving of 48 bytes or 17.8%; formatted with 2 spaces it is 329 bytes, so minifying that formatted text saves 108 bytes or 32.8%. Deeply nested documents with short values save the most. A document that is mostly long strings saves little, because nothing inside a string is touched. The result line shows the bytes in, the bytes out and the percentage saved.
Validation stops at the first problem and gives its line and column, both counted from 1, with an excerpt of that line in which the offending character is highlighted. Press Go to line to put the cursor there. For [1, 2,] it reports line 1, column 6: Trailing comma: remove the comma before ]. The usual culprits are trailing commas, single quotes, unquoted keys, comments and a missing comma between two values, none of which JSON allows.
Only when you press Sort keys; Format and Minify never move a key. Sorting applies at every depth, so nested objects are sorted too, while arrays keep their order. Keys are compared by their character codes, the same order JavaScript's sort() uses, so B comes before a and 10 before 9. A key that appears twice keeps both copies in their original relative order.
Base64, URL encoding, HTML entities and hex, both directions and UTF-8 correct, with URL-safe Base64 and padding options.
MD5 and SHA digests of text or any file, a checksum compare field, and up to 100 random UUIDs, all computed on your device.
Strip em dashes, curly quotes, hidden characters and stock AI phrases from any text, with a live diff of every change.
Flat or tiered plans with base pay and splits, plus a reverse mode that finds the sales needed to hit a target.