Browser Storage Size Estimator: How Much Can You Store?
In this article
Browser storage size estimators help you calculate how much data your browser can store locally using technologies like localStorage, sessionStorage, IndexedDB, and Cache API. The actual limit varies by browser and storage type, but most modern browsers allow around 5–10 MB per origin for localStorage, while IndexedDB and Cache API can store hundreds of MB or even gigabytes, depending on available disk space.
What Is Browser Storage?
Browser storage refers to data that a website can save on your device without using server-side databases. It includes several distinct technologies:
- localStorage – persists indefinitely, stores key-value pairs as strings.
- sessionStorage – similar to localStorage but cleared when the tab closes.
- IndexedDB – a full NoSQL database for structured data, supports large binary objects.
- Cache API – used by service workers to store HTTP responses for offline use.
- Cookies – small text data sent with every request; limited to about 4 KB each.
Each technology has its own limits and use cases. For example, localStorage is simple but synchronous and limited in size, while IndexedDB is asynchronous and can handle much larger datasets.
How Storage Limits Are Determined
Browsers enforce quotas per origin (protocol + domain + port) and also consider the total available disk space. The exact algorithm varies:
- Chrome/Edge (Chromium) – uses a pool-based system. Each origin gets a percentage of the overall disk space, typically 60% of the free space, with a per-origin limit that can be up to 10% of that pool. For localStorage, the limit is 5 MB per origin, but for IndexedDB it can be much larger.
- Firefox – similar pool approach; localStorage is limited to 5 MB per origin, while IndexedDB can use up to 10% of the disk space (with a minimum of 10 MB).
- Safari – historically stricter, with a 5 MB limit for localStorage and a 50 MB limit for IndexedDB, but newer versions allow more if disk space is available.
These limits are not fixed; they can change with browser updates. Also, private browsing modes may have separate, often lower, quotas.
How to Check Your Browser's Storage Usage
You can see how much storage a website is using through browser developer tools:
- Open the website you want to inspect.
- Press F12 (or right-click and select “Inspect”).
- Go to the Application tab (Chrome/Edge) or Storage tab (Firefox).
- Look for “Local Storage,” “Session Storage,” “IndexedDB,” and “Cache Storage” sections.
In Chrome, you can also type chrome://settings/content/all to see a list of all sites and their storage usage. Firefox users can check about:storage for a similar overview.
Using a Storage Size Estimator
An estimator helps you plan how much data your web app can safely store. Here’s how to use one effectively:
- Enter the approximate size of each record (e.g., a user profile object).
- Estimate the number of records you expect per user.
- Add overhead for keys, indices, and metadata (usually 10–20%).
- Compare the result with the browser’s per-origin limit.
For example, if you plan to store 1,000 user profiles, each about 2 KB, that’s 2 MB – well within localStorage’s 5 MB limit. But if you need to store images or videos, IndexedDB is a better choice because it can handle much larger files.
Common Pitfalls and Misconceptions
One common misconception is that localStorage is unlimited. It is not – it’s capped at 5 MB per origin in most browsers. Another mistake is assuming that clearing browser cache will free up localStorage; it won’t. You need to clear “site data” specifically.
Also, storage limits can be affected by:
- Incognito/private mode – often has lower quotas and data is cleared on exit.
- Disk space – if your device is low on space, the browser may reduce available quotas.
- Extensions – some extensions can interfere with storage APIs.
Another pitfall is using synchronous localStorage for large data, which can block the main thread and cause performance issues. Always use asynchronous APIs like IndexedDB for anything beyond trivial amounts.
How to Choose the Right Storage Type
Your choice depends on the data’s nature and size:
- Small key-value settings – use localStorage (e.g., theme preference, user ID).
- Session-specific data – use sessionStorage (e.g., form progress in a single tab).
- Structured, large data – use IndexedDB (e.g., offline database, media files).
- Offline resources – use Cache API (e.g., service worker caching for PWA).
For hybrid needs, you can combine them – for instance, store a small index in localStorage and the full data in IndexedDB.
Storage Quota and Eviction Policies
Browsers may evict stored data when the device runs low on space. The eviction process is not under your control, but you can prepare by:
- Checking the
navigator.storage.estimate()API to see usage and quota. - Handling
QuotaExceededErrorgracefully in your code. - Cleaning up old data regularly.
For example, you can use the following code to check storage usage:
navigator.storage.estimate().then(estimate => {
console.log('Usage:', estimate.usage, 'Quota:', estimate.quota);
});
This returns bytes, so divide by 1024² to get MB.
Frequently Asked Questions
What is the maximum size for localStorage?
In most browsers, the limit is 5 MB per origin. However, some browsers may allow a bit more (e.g., 10 MB in certain versions). The limit is per domain, not per page, and it applies to the total of all localStorage data for that domain.
How much data can IndexedDB store?
IndexedDB can store much more than localStorage – often hundreds of MB or even gigabytes, depending on the available disk space. The exact limit is dynamic and based on the browser’s storage pool. For example, Chrome allows up to 60% of free disk space, and each origin can use a portion of that.
Does clearing browser cache delete localStorage?
No, clearing the cache typically does not affect localStorage. To remove localStorage, you need to clear “site data” or “cookies and other site data” in your browser settings. Alternatively, you can use developer tools to delete specific entries.
Can I increase the storage limit?
You cannot directly increase the limit for localStorage. However, you can use IndexedDB or the Cache API, which have higher limits. Also, you can request persistent storage using the navigator.storage.persist() API, which reduces the chance of eviction, but it doesn’t increase the quota.
What happens when storage is full?
When you try to write more data than the quota allows, the browser throws a QuotaExceededError exception. Your code should catch this and handle it gracefully, such as by prompting the user to clear space or by using a different storage method.
Alternatives to Browser Storage
If browser storage is insufficient, consider server-side storage or a hybrid approach. For example, you can store large files on a server and keep only metadata locally. WebAssembly and WebRTC are not storage alternatives, but they can enable offline processing. Also, the File System Access API allows you to read/write files on the user’s device, though it requires user permission and is not available in all browsers.