Edit JSON Files in Chrome: Tools & Methods
In this article
The most direct way to edit JSON files inside Google Chrome is to use a browser extension such as JSON Viewer or JSON Editor, or to use the built-in DevTools console to modify and re-save the file. For quick, one-off edits, a web-based JSON editor works without installing anything. This article explains the options, how they work, and which one fits different situations.
Why Edit JSON in Chrome?
JSON (JavaScript Object Notation) is the standard format for data exchange on the web. Developers, testers, and data analysts often need to tweak configuration files, API responses, or local JSON files. Editing in Chrome is convenient because it avoids switching to a separate desktop editor, and some tools let you validate syntax as you type. Chrome itself does not have a native JSON editor—it only displays raw JSON or a tree view in DevTools—so you need an extension or an external web tool.
Built-in Chrome DevTools: View, Not Edit
Chrome's DevTools (F12 or right-click > Inspect) can display JSON in a readable, collapsible tree when you open a .json file directly in the browser. To do this, drag the file into a Chrome tab or type its file path. DevTools also shows JSON responses in the Network tab. However, DevTools does not allow in-place editing of a JSON file. You can copy the formatted text, edit it in the console using JavaScript, but you cannot save changes back to the original file without a separate tool.
Browser Extensions for JSON Editing
Several free extensions add editing capabilities directly in Chrome. The most common are:
- JSON Viewer – Formats and highlights JSON, and some versions include a basic edit mode where you can modify values and save the result as a new file.
- JSON Editor – Provides a form-based interface that lets you add, remove, and change fields without typing raw JSON.
- JSON Formatter – Focuses on formatting and validation, but often includes a "copy" button to grab the formatted text.
These extensions work by intercepting the browser's rendering of .json files or by adding a toolbar icon that opens an editor panel. After editing, you typically download the modified file or copy it to the clipboard. Note that extensions cannot overwrite the original file on your hard drive due to browser security restrictions—you must save the edited content manually.
Web-Based JSON Editors
If you prefer not to install anything, many websites offer free JSON editors that run entirely in the browser. They usually provide a text area on the left and a formatted tree or error list on the right. You paste your JSON, edit, and download the result. Some popular ones include JSONLint (for validation) and JSON Editor Online. These tools are handy for quick fixes, but they require copying the entire file content, which can be slow for very large files.
Using the Console for Programmatic Edits
For advanced users, the DevTools console can modify JSON data in memory. For example, you can fetch a JSON file, parse it, change a value, and then log or download the new version. Here's a simple example:
- Open DevTools (F12) and go to the Console tab.
- Type:
fetch('file.json').then(r => r.json()).then(d => { d.name = 'New Name'; console.log(JSON.stringify(d)); }); - Copy the output and save it as a new file.
This method is powerful but requires JavaScript knowledge. It does not modify the original file either; you must save the output manually.
Choosing the Right Tool
Consider the following when deciding:
- Frequency of edits – If you edit JSON daily, an extension with a dedicated editor is faster. For occasional tweaks, a web tool suffices.
- File size – Very large JSON files (over 10 MB) may slow down web editors. Extensions like JSON Viewer handle large files better because they render lazily.
- Need for validation – If you must ensure valid syntax, choose a tool that highlights errors in real time, such as JSON Editor Online.
- Privacy – Web-based editors send your data to their servers. For sensitive data, use an extension that processes locally, or use the console method.
Common Problems and Misconceptions
One common misconception is that you can edit a JSON file directly in Chrome and save it back to the same location. This is not possible due to browser security. Another issue is that some extensions only format JSON, not edit it—check the extension description. Also, when copying JSON from a web page, ensure you copy the entire content, not just the visible part, as some viewers collapse nested objects. Finally, remember that JSON requires double quotes, no trailing commas, and proper escaping—most editors will highlight these errors.
Frequently Asked Questions
Can I edit a JSON file directly in Chrome without any extension?
No, Chrome does not have a built-in JSON editor. You can view JSON in DevTools, but to edit and save, you need an extension or a web-based tool.
Will editing a JSON file with an extension overwrite the original file?
No, extensions cannot write to your local file system. You must download the edited file and replace the original manually.
Which extension is best for editing large JSON files?
JSON Viewer is often recommended for large files because it uses lazy rendering. However, editing very large files may still be slow; consider a desktop editor for files over 50 MB.
Is it safe to use online JSON editors with sensitive data?
Most online editors transmit data to their servers. For sensitive information, use an extension that works offline or the console method, which keeps data local.
How do I validate JSON after editing in Chrome?
Most editing tools show syntax errors as you type. You can also paste the edited JSON into JSONLint or use the console's JSON.parse() to check for errors.