Strict check first, repair only on request
Plenty of online editors patch input in the background. A trailing comma disappears, single quotes turn double, the tree renders, the page reports success. Then the original text fails in production, because JSON.parse in Node, json.loads in Python, or a PostgreSQL jsonb column follow RFC 8259 with zero tolerance.
This page runs the browser's own JSON.parse. A red status means a real parser rejects the text. Repair sits on its own button, rewrites the editor in place, then shows the result. Ctrl+Z puts your original back.
| You pasted | Strict check says | After Repair |
|---|---|---|
["eu-west", "us-east",] | Unexpected token ']' | ["eu-west", "us-east"] |
{'env': 'staging'} | Expected property name or '}' | {"env": "staging"} |
{retries: 3} | Expected property name or '}' | {"retries": 3} |
// copied from config | Unexpected token '/' | Comment line removed |
{"tls": True} | Unexpected token 'T' | {"tls": true} |
{"note": "line one | Unterminated string | {"note": "line one"}, a guess |
Where Repair goes wrong: a truncated API response gets closing brackets, not the missing records. The output parses, yet half the array is gone. Compare the key count in the status bar against what the source should hold before you trust a repaired payload.
Why the error line points one row too low
1{
2 "host": "staging.toolexe.com",
3 "port": 8443
4 "tls": true
5}
The parser reads "port": 8443 without complaint. A number followed by a line break is fine so far. Trouble starts on line 4, where a quote shows up instead of a comma or closing brace. The status bar reports line 4, column 3.
The fix belongs at the end of line 3. Whenever the message mentions an expected comma, colon, or bracket, read the row above the reported position first. Load broken JSON contains the same missing comma on line 5. Press Repair to see the comma added.
What Format, Minify, plus Sort keys rewrite
All three buttons parse the text, then serialize the parsed value again. Parsing is lossy in a few places. These are the ones worth checking before you overwrite a file in a repository.
- Whitespace
- Format applies 2 spaces, 4 spaces, or tabs. Minify drops every space outside strings. Spaces inside string values stay untouched.
- Key order
- Kept as typed. Sort keys orders object keys A to Z at every depth while arrays keep their order. Sort both sides before you diff two configs, otherwise the diff fills with moved lines.
- Duplicate keys
{"id": 1, "id": 2}formats to{"id": 2}without warning, since JSON.parse keeps the last value. Search for the key with Ctrl+F before formatting a hand-merged file.- Large integers
- JavaScript numbers hold integers exactly up to 9,007,199,254,740,991. The value 9007199254740993 comes back as 9007199254740992. The editor flags these numbers with their line before you press anything. 64-bit database IDs are the usual victims. Store them as strings in the source system.
- Escapes
"café"becomes"café","a\/b"becomes"a/b". Both forms parse to the same string, but a byte-level diff shows a change.
Keyboard shortcuts in the editor
On macOS use Cmd in place of Ctrl. Every button press counts as one undo step.
| Keys | Action |
|---|---|
| Ctrl+Shift+F | Format with the selected indent |
| Ctrl+Alt+M | Minify |
| Ctrl+F / Ctrl+H | Find / find plus replace |
| Ctrl+L | Go to line number |
| Ctrl+Z / Ctrl+Shift+Z | Undo / redo, including Repair |
| Gutter arrows | Fold one object or array in the text |
When another Toolexe page fits better
- JSON Viewer for multi-megabyte responses. The tree here lists 200 children per node, the viewer goes further.
- JSON Path Tester to pull one field from many records with an expression such as
$.items[*].sku. - JSON Parser when the input is escaped JSON inside a string, such as
"{\"a\":1}". This editor treats the whole thing as one string value. - JSON Cleaner to strip nulls or empty arrays across a document.