How to Clear localStorage in Chrome: DevTools, Console Command, or One Click
Clear localStorage in Chrome four ways: DevTools, the console command localStorage.clear(), site settings, or one click. Plus sessionStorage and IndexedDB.
On this page · 12 sections
- The short answer
- What localStorage is
- 1. DevTools: Application panel
- 2. The console command
- What about sessionStorage?
- 3. Without DevTools: clear site data
- localStorage vs IndexedDB
- Clear local storage on Android
- For developers: test as a first-time visitor
- Common mistakes
- Quick reference
- Frequently asked questions
To clear localStorage in Chrome, open DevTools, go to Application, then Local storage, pick the site and click Clear all. Or run localStorage.clear() in the Console. Both take about ten seconds and keep your cookies, so you stay signed in.
That covers most cases. The rest of this guide covers removing a single key, session storage, doing it without DevTools, and the mistakes that make people clear the wrong site.
The short answer#
- DevTools: Application, then Local storage, select the site, Clear all.
- Console:
localStorage.clear(), orlocalStorage.removeItem('key')for one key. - Session storage is separate:
sessionStorage.clear(). - No DevTools? Clear the site's data, which also clears cookies.
What localStorage is#
localStorage is a small key-value store each site keeps in your browser. MDN's Web Storage guide describes it: data stays until the site or you remove it, even after you close Chrome. Sites use it for settings, drafts, feature flags, cached content and sometimes sign-in tokens.
It is not the same as cookies or cache. It is not sent to the server with each request, and Chrome's "Cached images and files" option does not touch it. Our cache vs cookies guide explains where each kind of data lives.
Clear it when a web app behaves strangely after an update, when a setting is stuck, or when you test your own site as a fresh visitor.
1. DevTools: Application panel#
- Open the site and press F12, or Command+Option+I on a Mac.
- Click the Application panel. If you do not see it, use the
>>arrow. - In the left column, under Storage, expand Local storage and click the site's origin.
- To remove everything, click Clear all in the toolbar. To remove one item, select it and press Delete.
Chrome's DevTools docs also show how to edit a value in place by double-clicking it, which is useful for testing.
Watch for iframes: a page can contain frames from other origins, each with its own local storage. They appear as separate entries under Local storage. Clear the one you actually mean.
2. The console command#
Open DevTools, click Console, and run:
localStorage.clear() // every key for this site
localStorage.removeItem('theme') // one key
Object.keys(localStorage) // list keys before you delete
MDN documents Storage.clear() as clearing all keys stored in that storage object. The command runs for the site of the page you have open, so check the address first. In the Console's context menu at the top, make sure you are in the top frame, not an iframe, unless you mean to clear that frame's storage.
What about sessionStorage?#
sessionStorage works the same way, but lasts only as long as the tab. Closing the tab clears it. To clear it without closing:
- DevTools: Application, then Session storage, then Clear all.
- Console:
sessionStorage.clear().
3. Without DevTools: clear site data#
If you are not a developer, or you also want to reset the site completely:
- Address bar: the icon left of the address, then Cookies and site data, then Manage on-device site data, then delete the site.
- Settings:
chrome://settings/content/all, search the site, then Delete data.
Both remove local storage and cookies, so you are signed out of that site. To keep cookies, use DevTools' Clear site data with Cookies unticked. Our DevTools clear site data guide explains each checkbox.
Cleaner, our free Chrome extension, shows how many keys a site has saved before you clear it, and its Full reset clears local storage, session storage, IndexedDB, cookies, cache and service workers for that site in one click. Its Custom mode lets you pick only the storage types you want.
localStorage vs IndexedDB#
If clearing local storage did not reset an app, its data is probably in IndexedDB instead. Larger web apps, such as mail clients, editors and offline-capable tools, keep most of their data there because local storage is small and only holds strings.
- See it: DevTools, then Application, then IndexedDB, and expand the site's databases.
- Delete one database: select it and click Delete database.
- Delete everything for the site: Application, then Storage, keep IndexedDB ticked, untick Cookies if you want to stay signed in, and click Clear site data.
A quick rule: settings and small flags live in local storage; documents, messages and offline copies live in IndexedDB or Cache Storage.
Clear local storage on Android#
Chrome on Android has no DevTools of its own. Your options:
- Clear the site's data from the address-bar icon, which removes local storage with cookies.
- Remote debugging: connect the phone to a computer and open DevTools for the phone's tab. Chrome's remote debugging docs walk through it. Then use the Application panel or console as above.
For developers: test as a first-time visitor#
If you clear local storage to test your own site, clear everything a new visitor would not have, not just one store:
- Application, then Storage, keep every box ticked, and click Clear site data.
- Hard reload with Ctrl+Shift+R (Command+Shift+R on a Mac), because Clear site data does not empty the regular HTTP cache.
- Or open the site in a fresh Incognito window, which starts with no storage at all.
To reset only your app's own keys in code, prefer localStorage.removeItem() for the keys you own over localStorage.clear(), which also wipes keys set by other scripts on the same origin, such as analytics or consent tools.
Common mistakes#
- Clearing the wrong origin.
example.comandwww.example.comhave separate storage. So dohttpandhttpsversions. - Running the command in an iframe context. Check the frame selector in the Console.
- Expecting a sign-out. If the site keeps you signed in with cookies, clearing local storage alone will not sign you out.
- Expecting a fix for old files. If the page itself looks old, the cause is usually the cache or a service worker. See Chrome showing an old version of a website.
Quick reference#
| Goal | Do this |
|---|---|
| Clear all local storage for one site | DevTools, Local storage, Clear all |
| Remove one key | localStorage.removeItem('key') |
| Clear session storage | sessionStorage.clear() |
| Reset everything for the site but stay signed in | Clear site data with Cookies unticked |
| Reset everything, sign out too | Delete the site's data in Settings |
Frequently asked questions
How do I clear localStorage in Chrome?
Open DevTools with F12 or Command+Option+I, go to the Application panel, expand Local storage, select the site and click Clear all in the toolbar. Or type localStorage.clear() in the Console and press Enter. Both remove only that site's local storage and keep its cookies.
What is the command to clear local storage in Chrome?
In the DevTools Console, run localStorage.clear() to remove every key for the current site. Use localStorage.removeItem('key') to remove one key, and sessionStorage.clear() for session storage. The commands act on the site of the page that is open, so open the right site first.
Does clearing cache clear localStorage?
No. Cached images and files are separate from local storage. Chrome's Cookies and other site data option does clear local storage, together with cookies, for the sites and time range you choose, which also signs you out. To clear only local storage, use DevTools or the console.
How do I clear local storage in Chrome on Android?
There is no DevTools on the phone itself. Clear the site's data instead: open the site, tap the icon left of the address, and use Cookies and site data or Site settings to delete its data. This removes local storage together with cookies. Developers can also use remote debugging from a computer.