JavaScript Navigator storage Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

navigator.storage is a read-only property that returns the singleton StorageManager for this site — so you can estimate usage/quota and manage whether origin data should stay on disk (MDN).

Read the notes below before you rely on this property. Prefer feature detection when support is limited.

Syntax

Use navigator.storage. Start with this line.

JavaScript
navigator.storage
CallWhat it does
navigator.storagePrimary signature.

Built into the browser. Read navigator.storage on Navigator — no import required.

Library declarations
JavaScript
navigator.storage

Parameters

ParameterDescription
estimate()Optional. Approximate usage + quota in bytes
persist() / persisted()Optional. Request / check durable storage

Return Value

Return ValueDescription
*StorageManager

JavaScript Examples

Example 1 — Feature Detection

Check whether the StorageManager is available before calling it.

JavaScript
if (navigator.storage) {
  console.log("StorageManager available");
} else {
  console.log("StorageManager missing");
}
Try It Yourself

How It Works

  1. Read the property. If missing, it is undefined (falsy).
  2. Gate your code. Only call estimate / persist when present.
  3. Secure context. On plain HTTP (non-localhost) the API is usually unavailable.
  4. No side effects. Detection does not request permissions or write data.

Example 2 — Estimate Usage and Quota

Ask how much this origin uses and how much it may use (bytes, approximate).

JavaScript
async function showEstimate() {
  if (!navigator.storage || !navigator.storage.estimate) {
    console.log("estimate() unavailable");
    return;
  }
  const { usage, quota } = await navigator.storage.estimate();
  console.log("usage bytes:", usage);
  console.log("quota bytes:", quota);
}

showEstimate();
Try It Yourself

How It Works

  1. Detect methods. Guard both storage and estimate.
  2. Await the Promise. Resolves to an object with byte counts.
  3. Read usage. Rough bytes already used by this origin’s storage.
  4. Read quota. Rough upper limit; treat both as estimates, not exact ledgers (MDN).

Example 3 — Check and Request Persistence

See if storage is durable; request persistence when it is not.

JavaScript
async function ensurePersistent() {
  if (!navigator.storage) {
    console.log("StorageManager missing");
    return;
  }
  const already = await navigator.storage.persisted();
  console.log("already persisted:", already);
  if (already) return;

  const granted = await navigator.storage.persist();
  console.log("persist granted:", granted);
}

ensurePersistent();
Try It Yourself

How It Works

  1. Detect first. Skip if navigator.storage is missing.
  2. Ask persisted(). true means durability was already granted.
  3. Call persist() only if needed. Avoid redundant prompts / work.
  4. Respect false. Denial is normal — keep a “best effort” storage path.

Browser Support

Navigator.storage is part of the Storage API, marked Baseline Widely available on MDN (since December 2021). Requires a secure context.

✓ Baseline Widely available

Navigator.storage

Supported in Chrome, Firefox, Safari, Edge, and Opera. Entry point for estimate(), persist(), persisted(), and getDirectory().

Baseline Widely available
Google Chrome All modern versions
Yes
Microsoft Edge All modern versions
Yes
Mozilla Firefox All modern versions
Yes
Apple Safari All modern versions
Yes
Opera All modern versions
Yes
Internet Explorer Not supported
No
storage Excellent in browsers

Bottom line: Safe for modern quota checks and persistence requests. See the MDN storage reference. Always feature-detect and serve over HTTPS.

Frequently Asked Questions

It is a read-only Navigator property that returns the singleton StorageManager for the current site — used to estimate storage usage/quota and manage persistence of data stores.
No. MDN marks it Baseline Widely available (since December 2021). It is not Deprecated, Experimental, or Non-standard.
Yes. It is available only in secure contexts (HTTPS or localhost) in supporting browsers.
navigator.storage.estimate() returns a Promise that resolves to an object with usage and quota numbers (bytes) for your origin — approximate room left for local storage.
persisted() checks whether persistence is already granted. persist() requests that the browser keep your site’s storage when possible (may return true or false depending on browser heuristics and permission).
No. localStorage and sessionStorage are Web Storage key-value APIs. navigator.storage is the Storage API’s StorageManager for quota estimates and persistence across origin storage (IndexedDB, Cache, and related stores).

Next: usb

Learn how navigator.usb opens the WebUSB API for talking to USB devices.

usb tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful