Edit and Format JSON Online
Hosting and servers
Web hosting, virtual private servers and dedicated servers.
How to Edit and Format JSON in Your Browser
A JSON file with no indentation or highlighting, all on a single line, is hard to read and fix. This tool lets you open, edit, format, and save a JSON file directly in your browser, using the open-source jsoneditor editor (by Jos de Jong, version 9.1.0), with nothing to install.
What it's for
- Open a JSON file and review it as highlighted text or as a node tree.
- Spot syntax errors (a trailing comma, single quotes, an unquoted key) before using it in your code.
- Format (indent) a JSON file or compact it to a single line with one button.
- Sort, filter, or transform the content, and search for a value inside a large JSON file.
- Edit values or the structure itself, with undo and redo in case you make a mistake.
- Create a JSON file from scratch and save it as a
.jsonfile.
Two panels, six working modes
The screen shows two synced panels: whatever you change in one is reflected in the other. The left one starts in code mode (highlighted text with syntax validation) and the right one in tree mode (an editable tree); both can be switched to any of these six modes:
- code: the JSON as text, with highlighting and error warnings.
- text: the JSON as plain text, with no highlighting.
- tree: a fully editable tree, for adding, moving, or deleting keys and values.
- form: a tree where only the values can be edited, not the structure.
- view: a read-only tree, for inspecting without any risk.
- preview: a read-only text view meant for large documents.
The buttons in each mode
The toolbar changes depending on the mode:
- Format (
Ctrl+\) adds indentation and line breaks; Compact (Ctrl+Shift+\) puts it all on one line. Both in code mode. - Sort contents and Filter, sort, or transform contents: in code mode and in tree mode.
- Repair JSON (code mode): tries to fix common errors, see the next section.
- Undo (
Ctrl+Z) and Redo (Ctrl+Shift+Z): in both modes. - Expand all and Collapse all, plus a search box that jumps to the next or previous match: in tree mode.
How to create, edit, and save a JSON file
- Type or paste your JSON in the left panel, or click the load button to open a file from your computer (it's read in the browser and placed in both panels).
- Check the right panel in tree mode: since it's synced, every change automatically appears in the other panel.
- If you just want to change values, use form mode; to review without editing, use view or preview.
- Format it with Format, put it on a single line with Compact, or fix common errors with Repair JSON; Undo reverts any change.
- Click the save button, type a file name (if it doesn't end in
.jsonthat's added automatically), and download it.
Most common syntax errors
A valid JSON follows a strict grammar (RFC 8259):
- Trailing comma:
{"name": "Ana",}— that last comma needs to be removed. - Single quotes:
{'name': 'Ana'}should be{"name": "Ana"}. - Unquoted keys:
{name: "Ana"}— every key must be in double quotes. - Comments:
// this is not valid— JSON doesn't allow comments, neither with//nor with/* */.
Repair JSON tries to automatically fix misplaced quotes and escape characters, remove comments and JSONP notation, and convert a JavaScript object into valid JSON, though it doesn't guarantee fixing every error: it's worth checking the result. If your JSON includes a Unix timestamp or a token with a Base64url part (like a JWT), you can check it separately with the Unix timestamp converter or the Base64 decoder.
Privacy
The JSON you paste, load, or edit never leaves your browser: the page doesn't send its content to any server. Everything happens on your own computer, so you can work with data you'd rather not upload anywhere.