FormatterHQ

JSON Editor

Edit JSON in a full code editor while the structure is re-checked as you type. Errors are reported with their line and column, and a tree shows the result of every change.

Loading tool…
Ready.

How to use the JSON Editor

  1. Open your JSON: paste it, drop a file on the editor, choose one with Open, or start from Sample.
  2. Edit the text in the editor on the left. The document is re-parsed shortly after you stop typing and the Tree tab reflects your change.
  3. If an error appears under the editor, click Go to error to jump to it and fix the mistake, or press Repair to correct quotes, commas and comments automatically.
  4. Click Format to tidy indentation to 2 spaces (and Sort keys to order keys alphabetically), then Copy, Download or Save & Share the result.

An online JSON editor with a live check on every change

This online JSON editor gives you a proper code editor for JSON files together with a parser that watches what you type. Change a value, add a key or paste in a new block, and a moment later the tree on the right shows the updated structure, or the status bar tells you exactly what broke.

It is meant for the everyday edits that do not justify opening an IDE: adjusting a config file, fixing a fixture for a test, trimming an API response before sharing it, or cleaning up JSON someone pasted into a chat.

What the editor can do

  • Syntax highlighting for keys, strings, numbers and literals, with a dark theme when the site is in dark mode.
  • Line numbers and folding. Arrows in the gutter collapse an object or array so you can move a large block out of the way while you work on another.
  • Bracket help. Matching brackets are highlighted, and typing an opening quote or bracket inserts the closing one.
  • Search and replace with Ctrl+F (Cmd+F on a Mac), which is handy for renaming a key that appears many times.
  • Tab to indent selected lines, plus the usual undo and redo history.

Example: catching a missing comma

Suppose you add an autosave setting to this file but forget the comma on the line before:

{
  "theme": "dark",
  "fontSize": 14
  "autosave": true
}

The status bar shows Invalid JSON: Expected ',' or '}' but found '"' (line 4, column 3), and the same message appears under the editor with a Go to error button that puts the cursor on line 4. Notice that the report points at the start of the new key, not the end of line 3: the parser only realizes something is missing when it reaches the next token. When an error seems to be on a correct line, look at the line above it.

The tree is for checking, the text is for editing

The tree view is read-only. It exists to confirm that your edit produced the structure you intended, for example that a new object landed inside settings and not beside it. All changes happen in the text editor on the left. After a structural edit, glance at the item and key counts in the tree and at the depth in the status bar; a sudden change in depth usually means a bracket ended up in the wrong place.

Tidying up before you save

Hand edits tend to leave indentation uneven. Format rewrites the whole document with a 2-space indent, and Sort keys puts object keys in alphabetical order, which makes the next diff smaller if your team keeps files sorted. Minify writes the edited document on a single line when it needs to go into an environment variable or a request body.

If you pasted something that is not quite JSON, such as a JavaScript object with unquoted keys and single quotes, Repair converts it to valid JSON so you can keep editing.

Keeping and sharing your work

Download saves the editor text as json-editor.json. Save & Share stores the text and copies a link to your clipboard; opening that link later loads the saved JSON back into the editor. If you are signed in, you can choose whether a saved link is unlisted, public or private.

To see what changed between the original file and your edited copy, paste both into the JSON diff tool. To strip nulls and empty values in bulk instead of deleting them one at a time, use the JSON cleaner. For quick reading without editing, the JSON viewer keeps the focus on the tree.

Privacy

Editing, validation and formatting all run inside your browser tab, and nothing you type is uploaded while you work. Content reaches our server only when you choose Save & Share.

Frequently asked questions

Can I edit JSON directly in the tree view?
No. The tree is a read-only view of the parsed data. Edit the text in the editor on the left and the tree updates automatically a moment after you stop typing.
Why is the error reported on a line that looks correct?
Many mistakes, such as a missing comma or an unclosed string, are only detected when the parser reaches the next token. Check the end of the line above the reported one first.
Does the JSON editor save my changes automatically?
No. Your text stays in the page while it is open, but it is not stored anywhere. Use Download to save a file or Save & Share to store it and get a link you can reopen later.
Can I open and edit a large JSON file?
Yes, within the limits of your browser memory. For very large inputs the page waits a little longer after your last keystroke before re-parsing, so typing stays smooth, and tree branches are only built when you open them.
Can I edit JSON5 or JSON with comments?
You can type them, but the checks here follow strict JSON, so comments and trailing commas are reported as errors. Use the JSON5 formatter for files that are meant to keep those features.

Last updated October 3, 2026

Related tools

CSV Editor Online Edit CSV files online like a spreadsheet: change cells, add, move or delete rows and columns, sort, filter, find and replace, undo, then export. Online HTML Editor Write and edit HTML with autocompletion and a sandboxed live preview, then copy or download the finished document. Online Markdown Editor Write Markdown with a live side-by-side preview and the generated HTML source. Free online Markdown editor, no sign-up. Mermaid Live Editor Write Mermaid flowcharts, sequence, class, ER, Gantt and state diagrams with a live preview, then export SVG or PNG. Online Code Editor Multi-language online code editor with syntax highlighting for 30+ languages. Open, edit, save and download code files. Real-Time HTML Editor A real-time HTML playground for learning: edit HTML, CSS and JavaScript and watch the result update as you type. JSON Encode Online JSON encode text or a document into an escaped string, with each escaping rule explained and the json_encode flags that give identical output. JSON Fixer & Repair Fix broken JSON automatically: add missing quotes, commas and brackets, remove comments and trailing commas, and convert Python literals. JSON Flatten Flatten nested JSON into single-level key paths like user.address.city, with dot, custom or bracket notation for arrays. JSON Formatter Format, beautify and validate JSON online. Pretty print minified JSON with 2, 3, 4 space or tab indentation and pinpoint syntax errors. JSON Merge Patch (RFC 7396) Apply an RFC 7396 JSON Merge Patch to a document, or create the merge patch that turns one JSON document into another. JSON Minify Minify JSON by removing whitespace and line breaks. Shrink payloads for APIs, storage and embedding, and see the bytes saved.