Docs/Text, tree and table
JSON viewer: tree, table and text
Use JSON Editor Free as a JSON viewer: each panel can show its document as text, as a tree or as a table. Switching never changes the document: what you see in text mode after a round trip is exactly what you typed.
Switch the view
- Press Text mode, Tree mode or Table mode in the View group of the panel’s toolbar, or press Ctrl+Alt+1, Ctrl+Alt+2 or Ctrl+Alt+3.
- In text mode, type freely. Line numbers, colours for keys, strings and numbers, and matching brackets help you read it.
- Fold a block with the arrow in the gutter, or Ctrl+Shift+[ at the cursor, and open it again with Ctrl+Shift+].
- If the text is not valid JSON, the status bar and the notice above the text show the line, the column and what is wrong. F8 jumps to it.
Keys
View JSON: an example
To view JSON, paste it into a panel, open a file or drop one onto the panel, then pick tree or table mode. The JSON viewer shows the same document three ways, and you can switch at any time without changing it.
For example, take [{"name": "Ada", "address": {"city": "London"}}, {"name": "Alan"}]. Tree mode shows an array of 2 items; open the first item to see name and address, and open address to see city. Table mode shows 2 rows with the columns name and address.city; Alan has no city, so his cell shows a dash. Text mode shows the JSON itself, with colours for keys, strings and numbers.
Text mode
Text mode is a code editor for the raw JSON. Errors are underlined where the parser stopped, with the message in the gutter and in the status bar, for example “Line 3, column 18: Expected a comma or a closing brace }”.
Invalid text stays exactly as you typed it. Repair in the notice tries to fix it for you; see Format, compact, repair.
Tree mode
Tree mode shows one row per key or item. Containers show how many keys or items they hold, and a collapsed object shows its name field as a hint. Click the arrow, or press → and ←, to open and close a row.
Everything you can change in tree mode is on Editing in tree mode.
Table mode
Table mode shows an array as rows: the whole document when it is an array, otherwise the first array of objects it finds. When there are several arrays, a menu above the table chooses which one.
Each nested field becomes a column, such as address.city. Missing values show as a dash. Click a column title to sort by it; click again for the other direction. Press Enter, or double-click a cell, to edit it.
Use it as a JSON viewer
- Paste JSON, open a file, drop one onto a panel or open a web address; see Open, save and CSV.
- In tree mode, Ctrl+Shift+E opens every level and Ctrl+Alt+E closes them all, so you can read the outline first and open only what you need.
- In table mode, an array of objects reads like a spreadsheet: one row per item, one column per field, sorted by any column.
- To find a key or value, search the panel; see Search and replace.
- Files too big for text mode open in tree and table mode; see Large documents.
- Viewing never sends the document anywhere: it stays in your browser; see Local storage and privacy.
Nothing is lost
Large integers such as 12345678901234567890, long decimals, escapes like \u00e9, emoji and the order of keys all stay exactly as written in every mode, and when you save.
Only what you edit changes. If you edit one value in tree mode, the rest of the text keeps its numbers and escapes.