What does the JSON Formatter do?
The KitLumi JSON Formatter turns compact JSON into readable, indented text and checks strict JSON syntax. It also supports recursive key sorting, minification, JSON5 repair, exact-number parsing, file input, undo and redo, a tree with on-demand branches, optional local draft restore, printing, and fullscreen editing.
Formatting changes whitespace, not the parsed JSON value. Minifying performs the reverse operation by removing optional whitespace. The parser follows the JSON grammar described in RFC 8259 (opens in a new tab).
Does this JSON Formatter send data to a server?
No. The JSON Formatter uses browser-side parsers and a local Web Worker for standard input at or above 100 KB. Your input is not submitted to a KitLumi endpoint or added to the page URL. It is written to local storage only when you deliberately enable Remember draft, and disabling that option removes the saved draft.
How do you format and validate JSON?
- Paste, type, or open JSON. Validation starts after a short pause when Auto format is enabled. Use Sample if you want a safe example.
- Choose the output. Select two, three, or four spaces or tabs. Turn on Sort keys, Minify, Lossless numbers, or Tree view when needed.
- Fix or export. Invalid JSON shows a parser message with its line and column when available. Valid output can be copied or downloaded as
formatted.json.
Should you format or minify JSON?
Format JSON when a person needs to read, review, or debug it. Minify JSON when whitespace size matters and people do not need to edit the payload directly.
| Mode | Best for | Whitespace | Data value |
|---|---|---|---|
| Format | Code review, debugging, documentation | Adds indentation and line breaks | Unchanged |
| Minify | Compact payloads and storage | Removes optional spaces and line breaks | Unchanged |
What does formatted JSON look like?
A compact object such as {"name":"KitLumi","local":true} becomes the following two-space-indented JSON:
{
"name": "KitLumi",
"local": true
}Both versions represent the same object. The formatted version is easier to scan and produces clearer code-review diffs.
What are the most common JSON syntax errors?
| Invalid pattern | Why it fails | Valid replacement |
|---|---|---|
| {'name': 'Ada'} | JSON strings and property names require double quotes. | {"name": "Ada"} |
| {"a": 1,} | Strict JSON does not allow a trailing comma. | {"a": 1} |
| {name: "Ada"} | Property names cannot be bare identifiers. | {"name": "Ada"} |
| {"a": undefined} | undefined is not a JSON value. | {"a": null} |
| {"a": 1 // note} | JSON does not support comments. | Remove the comment or store it as a string field. |
What should you check before formatting sensitive or numeric data?
The JSON Formatter runs locally, but browser extensions and device policies are outside this page’s control. Use a trusted browser profile for secrets. Standard mode represents JSON numbers as JavaScript values; enable Lossless numbers when every numeric digit must remain exact. Quote large identifiers when they are identifiers rather than values used for arithmetic.
Frequently asked questions about JSON formatting
Does the JSON Formatter upload my data?
No. The JSON Formatter parses and formats input inside your browser. It is not sent to a KitLumi server or added to the URL. Browser storage is used only if you explicitly enable Remember draft.
What is the difference between formatting and minifying JSON?
Formatting adds line breaks and indentation for people to read. Minifying removes optional whitespace for a smaller payload; both outputs represent the same JSON value.
Why is my JSON invalid?
Common causes are trailing commas, single-quoted strings, comments, unquoted property names, and missing brackets. Strict JSON requires double quotes and does not allow comments or trailing commas.
Can the JSON Formatter sort object keys?
Yes. Enable Sort keys to order keys recursively in every object. Array item order is preserved because changing array order would change the data.
Can I format very large JSON files?
Large input is processed in a Web Worker after it reaches 100 KB, which helps keep the page responsive. The practical limit still depends on the memory available to your browser and device.
Will the formatter preserve very large numbers exactly?
Yes when Lossless numbers is enabled. Standard mode uses the browser JSON parser, while lossless mode keeps the original JSON number text instead of rounding through JavaScript Number.
What changed?
Moved large input and lossless-number parsing to a Worker, disabled expensive highlighting for large output, and added on-demand tree branches with batches of 100 children.