Is my JSON uploaded anywhere?
No. Formatting, validation and the tree view run in JavaScript inside this tab. Nothing is sent to a server, so it is safe for internal payloads and customer data.
What is the difference between a JSON formatter and a JSON validator?
A validator checks whether text is valid JSON and tells you where it breaks. A formatter rewrites valid JSON with readable indentation, or minifies it. This tool validates first, then formats, because invalid JSON cannot be formatted reliably.
How do I fix "Unexpected token in JSON at position 0"?
That error means the text is not JSON at all, most often an HTML error page or a redirect returned by the server. Check the response status code and Content-Type before parsing. If it is JSON, paste it here to find the exact problem.
Does it support comments or trailing commas?
No, because standard JSON does not. Those are features of JSON5 and JSONC. The validator points to them so you can remove them before an API or parser rejects the file.
Why are large numbers changed after formatting?
JavaScript numbers are 64-bit floats, so integers above 9,007,199,254,740,991 lose precision when parsed. Send very large IDs as strings to keep them exact.
Why did a key disappear after formatting?
Your JSON probably contains the same key twice in one object. JSON.parse keeps only the last value, so the formatted output has one copy. Duplicate keys are allowed by the grammar but discouraged by RFC 8259, and parsers handle them differently.
Why did the order of my keys change?
Keys that look like non-negative integers, such as "1" or "42", are moved first in ascending order. This is how JavaScript orders object properties. Other keys keep their original order.
Is a single string or number valid JSON?
Yes. Since RFC 8259, any JSON value can be the top-level value, including "text", 42, true or null. Some older parsers only accept an object or array at the top level.
Can it format JSON Lines (NDJSON)?
Not as one document. NDJSON has one JSON value per line, so the validator reports unexpected content after the first value. Paste one line at a time to check it.
Should I indent JSON with 2 spaces, 4 spaces or tabs?
It is a style choice with no effect on the data. Two spaces is the most common convention in JavaScript projects and API documentation; match whatever your codebase or formatter already uses.
How large a file can it handle?
Several megabytes format comfortably in a modern browser. Very large files may make the tree view slow; use the text view for those.