JSON Editor

Paste a payload or open a .json file. The editor parses on every keystroke, marks the first syntax error with line plus column, then draws the structure as a tree you collapse node by node. Nothing in your text changes until you press a button.

Structure

The tree appears once the editor holds valid JSON.

PathClick a key in the tree
Empty Paste JSON, open a file, or load a sample.

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.

Six common breakages, the Chrome error text, plus what Repair writes
You pastedStrict check saysAfter 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 configUnexpected token '/'Comment line removed
{"tls": True}Unexpected token 'T'{"tls": true}
{"note": "line oneUnterminated 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.

KeysAction
Ctrl+Shift+FFormat with the selected indent
Ctrl+Alt+MMinify
Ctrl+F / Ctrl+HFind / find plus replace
Ctrl+LGo to line number
Ctrl+Z / Ctrl+Shift+ZUndo / redo, including Repair
Gutter arrowsFold 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.

JSON Editor questions

Does the editor keep my JSON between visits?

No. A reload clears the editor. Press Download before you close the tab if you need the edited file.

Are comments allowed, as in tsconfig.json or VS Code settings?

The strict check rejects them, the same way JSON.parse in Node or Python json.loads would. Repair strips comments. Keep the original file when the comments carry meaning, since Repair deletes them for good.

How large a file works here?

Typing stays smooth up to a few megabytes. Past roughly 10 MB each keystroke triggers a full parse, so the tab slows down. For files of this size, open the JSON Viewer or run jq on the command line.

Why does a tree node say more items are hidden?

Each object or array lists its first 200 children in the tree to keep typing responsive. The editor text holds everything. Format, Minify, Copy, plus Download all work on the full document.

Does Repair upload my data?

No. The first press of Repair downloads the open-source jsonrepair library into the page. The library runs in your tab. Editor content never leaves the browser.