User Agents

Web browsers and everyday web tech, explained

Edit Local Storage Data in Chrome, Edge, and Firefox

· 5 min read · Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Editing local storage data allows you to manually change the key-value pairs a website saves in your browser. This is primarily used by developers to test different application states, bypass certain client-side flags, or debug how a site handles stored user preferences without having to navigate through the actual user interface of the website. By accessing the browser's built-in developer tools, you can add, modify, or delete data that persists even after the browser window is closed.

What You'll Need

  • A desktop computer running a modern web browser (Google Chrome, Microsoft Edge, or Mozilla Firefox).
  • A website that utilizes the Web Storage API (local storage).
  • Basic understanding of key-value pairs (e.g., "username": "JohnDoe").

Step-by-Step

  1. Open the Target Website: Launch your browser and navigate to the specific URL where you want to edit the stored data.
  2. Open Developer Tools:
    • Chrome and Edge: Right-click anywhere on the page and select Inspect, or press F12 (Windows/Linux) or Cmd + Option + I (Mac).
    • Firefox: Right-click and select Inspect, or press F12 (Windows/Linux) or Cmd + Option + I (Mac).
  3. Navigate to the Storage Tab:
    • Chrome and Edge: In the top menu bar of the DevTools panel, click on the Application tab. If you do not see it, click the double arrow (>>) icon to reveal hidden tabs. In the left-hand sidebar, locate the Storage section and expand Local Storage. Click on the domain name of the site.
    • Firefox: In the top menu bar of the DevTools panel, click on the Storage tab. In the left-hand sidebar, expand the Local Storage folder and select the domain name of the site.
  4. Locate the Key to Edit: You will now see a table with two columns: Key and Value. Scroll through the list to find the specific piece of data you wish to change.
  5. Modify the Value:
    • Double-click directly on the Value cell for the key you want to edit.
    • Type in the new value.
    • Press Enter to save the change.
  6. Add New Data (Optional):
    • Double-click the empty row at the bottom of the list.
    • Enter a new name in the Key column and a corresponding value in the Value column.
    • Press Enter.
  7. Delete Data (Optional):
    • Right-click the specific row you want to remove.
    • Select Delete from the context menu.
    • Alternatively, select the row and press the Delete key on your keyboard.
  8. Apply Changes: Most websites will not reflect the change instantly because the data is read when the page loads. Refresh the page (F5 or Ctrl + R) to see how the website reacts to the modified local storage data.

Common Mistakes

  • Incorrect Data Types: Local storage only stores data as strings. If a website expects a number or a boolean (true/false) and you enter text that cannot be parsed, the website may crash or revert to default settings.
  • JSON Formatting Errors: Many modern sites store complex data as JSON strings (e.g., {"theme":"dark","fontSize":14}). If you edit a JSON string and forget a quote or a curly bracket, the application will likely fail to read the data.
  • Editing the Wrong Domain: If a site uses multiple subdomains or iframes, ensure you have selected the correct origin in the sidebar, as each domain has its own isolated local storage.
  • Forgetting to Refresh: Changes made in DevTools update the storage, but the active JavaScript running on the page may have already cached the old value in memory. Always refresh the page.

Tips

  • Backup Your Data: Before making significant changes, take a screenshot of the existing keys and values or copy them into a text editor so you can restore them if the site stops working.
  • Use the Console for Bulk Edits: If you need to change many values at once, use the Console tab. Type localStorage.setItem('key', 'value') to add/edit or localStorage.clear() to wipe everything.
  • Search Function: If the list of keys is long, use the filter box (usually located at the top of the storage table) to search for specific keywords.

Troubleshooting

  • Storage Tab is Missing: In Chrome/Edge, the Application tab is sometimes hidden behind the >> icon if your window is too narrow. Expand the DevTools window to full screen.
  • Changes Revert Immediately: Some websites have scripts that constantly monitor local storage or sync it with a server. If your changes are overwritten instantly, the site is likely using a listener or a synchronization loop.
  • Value Won't Save: Ensure you are pressing Enter after typing the new value. Clicking away from the cell without pressing Enter may discard your changes in some browser versions.
  • Site Doesn't Change After Refresh: Check if the site is using Session Storage or Cookies instead of Local Storage. These are located in the same sidebar menu under the Storage section.

Frequently Asked Questions

Is editing local storage safe?

Yes, it is safe for your computer. However, it can cause the specific website you are editing to behave unexpectedly or crash until you clear the storage or refresh the page.

Does this change data on the website's server?

No. Local storage is stored entirely on your own device. Changes made here do not affect other users or the website's database unless the site is designed to upload local storage changes to a server.

What is the difference between Local Storage and Session Storage?

Local storage persists even after the browser is closed and reopened. Session storage is cleared as soon as the specific browser tab or window is closed.

Can I edit local storage on a mobile browser?

Standard mobile browsers (like Chrome on Android or Safari on iOS) do not have built-in developer tools. To edit local storage on mobile, you typically need to connect the device to a desktop computer and use remote debugging tools.

Why are some values encoded in strange characters?

Some developers use Base64 encoding or encryption to prevent users from easily reading or editing local storage data. If the value looks like a random string of characters, it is likely encoded.