Browser troubleshooting
Inspect an estimated browser storage quota
Use navigator.storage.estimate when available to inspect an origin’s estimated usage and quota. These are browser-managed storage figures, not free physical RAM or a promise that the next write will succeed.
Worked example
Browser console example · use a disposable page on your own site
if (navigator.storage?.estimate) {
const {usage, quota} = await navigator.storage.estimate();
console.log({usage, quota});
} else {
console.log("Storage estimates are unavailable");
}How it works
The estimate covers storage managed under the API’s origin context, such as IndexedDB and cache data according to browser accounting. It can help explain why a large offline dataset cannot be saved. Keep values labeled as estimates and display appropriate units.
Limits and mistakes
Browsers may pad values for privacy and adjust quotas dynamically. LocalStorage has separate practical constraints and should not be assumed to accept the entire estimated quota. Available disk space and eviction policies also affect outcomes.
Check the result
Check that returned values are finite when supplied, and compare before and after a small controlled storage operation. Handle unsupported contexts without displaying a misleading zero quota.
Sources
Reference documentation for the behavior used in this guide: