What counts as valid JSON
JSON (RFC 8259) is stricter than a JavaScript object literal, and most "invalid JSON" errors come from that gap. Keys must be strings in double quotes - {name: 1} and {'name': 1} are both rejected. Strings must use double quotes too. There are no trailing commas after the last element of an object or array, and no comments of any kind. Numbers cannot have a leading zero (012), a leading plus sign, or be NaN, Infinity or hex. The only literals are true, false and null; undefined, dates and functions are not JSON values. Whitespace between tokens is free, which is all pretty printing changes.
How formatting, minifying and error location work
The tool parses your input with the browser's built-in JSON.parse and re-serializes it with JSON.stringify, indented with 2 spaces, 4 spaces or a tab. Minify produces the same data with every optional space and line break removed - handy for embedding a config in an environment variable or shrinking a request body. Sort keys reorders every object's keys alphabetically at every depth, which makes two documents easy to diff. Neither operation changes any value.
When parsing fails, the browser's error message is mined for a position: Chrome and Edge report a character offset and, in recent versions, a line and column; Firefox reports line and column directly; Safari often reports nothing. If no position is available, a small built-in scanner walks the text and stops at the first character that breaks the grammar. The caret marks where the parser gave up, which is usually just after the real mistake - a missing comma is reported at the start of the next key, for example.
Stats and things to watch
After a successful parse you see the top-level type, total key count across all nested objects, how many objects and arrays it contains, and the maximum nesting depth (the top-level container is depth 1). Sizes are in UTF-8 bytes, which is what your server and network actually see; a non-ASCII character can take 2-4 bytes even though it is one character.
One JavaScript-specific caveat: numbers are IEEE 754 doubles, so integers above 9,007,199,254,740,991 (2^53 - 1) lose precision. A Twitter or Snowflake ID like 1234567890123456789 will come out as 1234567890123456800 after formatting. The tool warns when it spots a 16-digit-or-longer integer; the fix is to transport such IDs as strings. For files larger than a few megabytes, a command-line tool like jq or python -m json.tool will be faster than any browser page.