LocalStorage / IndexedDB Quota Estimator

Estimate how much browser storage your payloads will consume and reduce the risk of QuotaExceededError surprises.

PWA & Browser Storage Local processing Payload data is processed in your browser.

Estimator

Results

Enter data and calculate a storage estimate.

Introduction

Browser storage is convenient until it fails unexpectedly. localStorage often has a small per-origin limit, while IndexedDB can store much larger structured data but has less predictable quota behavior.

This tool helps you estimate payload size before shipping a feature that depends on client-side persistence.

How it works

The tool calculates the size of your input using standard browser APIs. For localStorage, it assumes UTF-16 code units because browser string storage is commonly described in those terms. For IndexedDB, it provides a UTF-8 lower bound and a UTF-16 conservative estimate.

  • Text length provides UTF-16 code units.
  • TextEncoder provides UTF-8 byte size.
  • Record count multiplies the estimate.
  • Optional overhead accounts for wrapper structures.

How to use

  1. Paste JSON or text into the payload field.
  2. Select the input type.
  3. Enter the localStorage key if relevant.
  4. Set the number of records you expect to store.
  5. Add optional overhead if your wrapper objects increase size.
  6. Run the analysis and review warnings.

Practical example

A settings object may be small enough for localStorage, but thousands of cached records can quickly exceed the common 5 MiB soft limit. Use the record count field to test the worst-case size before implementing persistence.

Use cases

  • Estimating whether cached API responses fit in localStorage.
  • Deciding between localStorage and IndexedDB.
  • Testing the size impact of JSON minification.
  • Planning offline storage for PWA features.
  • Debugging unexpected quota errors.

Best practices

  • Use localStorage for small preferences and lightweight state.
  • Use IndexedDB for larger structured records.
  • Compress or prune data before persisting it.
  • Handle QuotaExceededError gracefully.
  • Test with realistic payload sizes, not toy examples.

Common mistakes

  • Assuming localStorage can store megabytes of data safely.
  • Forgetting that pretty-printed JSON increases payload size.
  • Ignoring key size.
  • Storing duplicate data across multiple keys.
  • Assuming IndexedDB quota is unlimited.

Limitations

  • Actual quota limits vary by browser and device.
  • IndexedDB structured clone overhead is not exact.
  • Storage pressure and eviction policies can affect persistence.
  • The current origin estimate reflects this website’s storage, not another site’s storage.

Browser compatibility

  • localStorage: Widely supported, but quota limits vary.
  • IndexedDB: Widely supported in modern browsers.
  • navigator.storage.estimate(): Supported in many modern browsers, but not all.

FAQ

Is my payload uploaded?

No. The payload is processed locally in your browser.

Why is the localStorage estimate based on UTF-16?

JavaScript strings are commonly measured in UTF-16 code units, and many storage quota explanations use that model. This produces a practical estimate for string storage.

Is IndexedDB unlimited?

No. IndexedDB can store much more than localStorage, but quota still depends on available device storage, browser policy, and persistence mode.

Can this tool read my site’s localStorage?

No. It estimates the data you paste into the tool. It does not automatically read another website’s storage.

References

Version and changelog

  • Version: 1.0.0
  • Last updated: August 8, 2026
  • Changelog: Initial production release.