Storage Quotas

There were several attempts made, mostly by Google Chrome, to allow Web applications to query the system for the size of the storage space currently used and available for the application. The most recent one, Quota Estimation API, is also in development in Firefox as of June 2017.

The older implementation, supported only in Chrome with webkit- prefix, maintained a separation between the temporary and persistent storage and allowed the Web applications to request for more storage space, if needed.

API glimpse
Returns a Promise resolved with the storage space estimated values; see below.
Returns the estimated size of the storage currently used by the application, in bytes.
Returns the estimated total size of the storage available for the application, in bytes, including already used.

Live Demo

Estimated storage usage is unknown bytes.

Estimated storage quota is unknown bytes.

Estimated usage is unknown%.

  • if ('storage' in navigator && 'estimate' in {
        .then(estimate => {
          document.getElementById('usage').innerHTML = estimate.usage;
          document.getElementById('quota').innerHTML = estimate.quota;
          document.getElementById('percent').innerHTML = (estimate.usage * 100 / estimate.quota).toFixed(0);
  • <p>Estimated storage usage is <b id="usage">unknown</b> bytes.</p>
    <p>Estimated storage quota is <b id="quota">unknown</b> bytes.</p>
    <p>Estimated usage is <b id="percent">unknown</b>%.</p>