JSON Editor — Tips & Tricks

Tips for the JSON Editor: the right view, syntax vs. schema, the limits of repair, exact numbers, local storage and combining it with other tools.

Back to the overview: JSON Editor · Open the tool live: www.jpkc.com/tools/json/

The manual explains every feature, the examples show the workflows. This page is about what both assume but rarely spell out: which view fits which task, what the syntax check does not do, why big numbers are safe here and where to be careful on a shared machine. Button names appear exactly as they do in the tool's interface.

The right view for the task

The three views show the same document but are made for different jobs. Picking the right one consistently makes you noticeably faster:

  • Tree for understanding and reshaping structure — collapse and expand, reorder via drag-and-drop, edit individual values precisely. Also the entry point to the Transform tool.
  • Table for uniform lists — an array of objects reads and edits far faster as a table than in the tree. Sort columns by clicking, add/remove rows.
  • Text for the raw view and repair — when you need to check the exact structure, fix broken JSON by hand or use search & replace. Format, Compact and Repair switch here anyway.

Rule of thumb: lists → Table, broken or raw JSON → Text, everything else → Tree.

Valid isn't the same as schema-checked

The most common misconception: "The editor says the JSON is valid — so my data is correct." Only half true. Real-time validation checks the syntax — whether the JSON is well-formed (correct brackets, quotes, commas). It does not check whether your data conforms to a schema or contract: whether an expected field is missing, a string appears where a number belongs, or a value falls outside the allowed range. A green "valid" means "readable as JSON" — not "correct in substance".

For the substance, the editor has the Schema button: you supply a JSON Schema (draft 4, 7, 2019-09 or 2020-12), and the editor marks every deviation as a warning — permanently, until you click Remove schema. That pays off above all when you edit the same kind of document again and again, say a configuration or the response of one particular API: the schema stays stored in the browser and checks along automatically on your next visit. Make sure the schema is self-contained — the tool doesn't fetch external $refs. Example 7 shows what this looks like in practice.

Repair: what works, what doesn't

The Repair button (or Auto repair in the Text view) is strong on the common, unambiguous mistakes — trailing commas, single instead of double quotes, unquoted keys, comments, missing closing brackets at the end. Add two cases that are easy to overlook when copying from someone else's output: JSONP responses (callback({...})) and Python output with True, False and None instead of true, false and null. Exactly the cases that arise when copying from code, logs or loose config formats.

Where the repair hits its limits: ambiguous or structurally broken input. When it's unclear where a bracket in the middle of the document belongs, the heuristic can't guess either. And duplicate keys are deliberately left alone by Repair — which of the two values is the right one is your call. So the order is: click Repair, fix whatever remains by hand using the message, and finish with Format for clean indentation. Don't like the result? Ctrl+Z restores the starting point. With truly broken sources it's worth obtaining a clean original again rather than patching for ages.

Compact + Sort: reproducible output

Two buttons combine into a useful trick: when you want to compare two JSON documents (e.g. in a diff), different key orders and indentation get in the way. On both, hit Sort keys first (sorts all keys recursively), then Compact (or Format for a line-by-line diff) — now the files differ only where something has substantively changed. Two things to note: Sort keys only sorts object keys, not the order of array elements. And it sorts "naturally" and case-insensitively (key2 before key10) — other tools often sort strictly by character code. So for a comparison, sort both documents with the same tool.

If you only need the compact version to pass it on, you don't have to rebuild your readable document for it: File → Copy compact and Download compact (.min.json) deliver the minified version while the editor stays formatted.

Big numbers and duplicate keys

A tool that relies on the browser's built-in JSON parser may change your data without telling you: that parser only knows 64-bit floating-point numbers. The order number 12345678901234567890 turns into 12345678901234567000, and 1.10 into 1.1. With 64-bit database IDs or amounts with fixed decimal places, that's genuine data loss. The JSON Editor parses with lossless-json and leaves every digit in place — through Format, Compact, Sort keys and Download. Try it with the sample document: its orderId 9007199254740993 sits just above the point where floating-point numbers can no longer represent every integer, and still stays exact.

Same with duplicate keys: a normal parser quietly keeps the last value. The editor names the key and leaves the document as text. When you see "Duplicate key …", find the spot with Ctrl+F and decide for yourself which value stays.

Local storage: convenience and pitfall

The editor saves your work automatically in the browser and restores it on your next visit — very convenient against accidental reloads. A few things to know:

  • Shared or borrowed machine: the content stays in the browser until you empty it with File → Clear. A stored JSON Schema isn't affected by that — only Remove schema in the Schema dialog removes it. So after working with sensitive data on a device that isn't yours, don't forget either.
  • No sync, no backup: the state lives only in this browser's local storage. It doesn't travel between devices and is gone if you clear the browser's data. Whatever you want to keep, save as a file via Download.
  • Large documents aren't saved: above 2 million characters the badge shows Not saved — too large, and an older copy is deleted. Here a download before you close the tab is a must.

Reassuringly, your document never leaves the browser — it's stored locally only, nothing is uploaded. The one feature that involves a server is Load from URL: there you only send the address to the website's proxy, which fetches the JSON from it.

Loading by URL: public, small, no login

File → Load from URL… saves you the detour via download and open, but it has clear limits: publicly reachable http/https addresses only, at most 2 MB, no custom headers and no credentials. The proxy rejects internal addresses (localhost, intranet, private IP ranges). For an API that needs a token, or a server on your own network, download the response with curl or in the browser and drop the file onto the editor. For public endpoints, feeds and sample data, on the other hand, loading by URL is the quickest route.

Keyboard and large documents

  • Stay on the keyboard: Ctrl+O opens a file, Ctrl+S downloads the document — both also work while the cursor is in the editor. Search (Ctrl+F), replace, undo/redo and, in the Text view, formatting (Ctrl+I) have shortcuts too. On a Mac, use Cmd each time.
  • Fullscreen for large files: the fullscreen button gives the editor the whole screen; Esc ends it again. If a dialog, a menu or the search is open, or you're editing a value, Esc doesn't end fullscreen — so you don't lose it by accident when all you wanted was to cancel something.
  • Very large files are possible but memory-hungry: the real ceiling is your browser's memory. If huge files get sluggish, the Text view helps (lighter than tree/table), as does closing other tabs. The statistics in the footer give you a quick idea of size and nesting depth.

Combining with other JPKCom tools

The JSON Editor is often just one stop — these tools follow on seamlessly:

  • Wrong format? Convertor PRO turns JSON into YAML, TOML, XML and back. Workflow: tidy up and validate in the JSON Editor, then convert to the target format in Convertor.
  • Really a table? If your array of objects is better off as CSV, the CSV Editor takes over — edit, detect the format, export.
  • Encoded values in the JSON? If Base64 blobs, URL-encoded strings or JWT tokens sit in your fields, the Coder decodes and encodes them — then back to the JSON Editor to check.

There's more context: the overview for the big picture, the manual for every feature in detail and the examples for the step-by-step workflows. You can try it all directly in the tool.