Valid is the beginning of the job, not the end of it
The reason anyone pastes JSON into a web page is that something has gone wrong. An endpoint returned a shape nobody expected, a config file will not load, a log line contains a nested object four levels deep on one unbroken line. Finding out that it parses is progress, but the actual question - which field is missing, which array came back empty, where the nesting went one level further than the code assumed - needs the document laid out.
Then it usually has to go back. Into a request body, into an environment variable, into a test fixture, into a curl command - and in every one of those places the indentation you just added is a liability. Format and minify are the same operation run in opposite directions, and splitting them across two tools means two pastes of the same sensitive document.
What actually makes JSON invalid
Nearly every failure is one of five things: a trailing comma, a key that is not double-quoted, a single quote where a double quote belongs, a comment, or NaN and Infinity appearing as numbers. JSON is stricter than the JavaScript object literal it resembles, and the gap between the two is exactly where these mistakes live.
The awkward case is a file that works in one tool and fails in another. That almost always means the permissive tool is accepting comments or trailing commas as an extension. The file is not portable JSON, whatever it looked like when it worked, and it will fail again on the next parser that follows the specification.
The payload is usually somebody else data
An API response being debugged is rarely synthetic. It has real names in it, real email addresses, real order values, sometimes an access token in a header that got copied along with the body. That is a normal thing to be holding while you work and an odd thing to post to a third party on the way to reading it.
This page reads and rewrites the document with the JSON parser already in your browser. There is no upload, so there is no retention question to ask and no size cap to run into. You can watch the network tab while you format a ten megabyte response and see that nothing goes out.