---
title: "What are IndexedDB's storage limits across different browsers/platforms?"  
description: "What are IndexedDB's storage limits across different browsers/platforms?"  
author: "ICSM Computer"  
published: 2025-07-18  
updated: 2025-07-18  
canonical: https://www.mindstick.com/interview/34337/what-are-indexeddb-s-storage-limits-across-different-browsers-platforms  
category: "IndexedDB"  
tags: ["database", "indexeddb"]  
reading_time: 5 minutes  

---

# What are IndexedDB's storage limits across different browsers/platforms?

IndexedDB storage limits vary by **browser**, **platform (desktop vs mobile)**, and **usage context (e.g., secure context, quota management)**. They are usually **quota-based**, often tied to available disk space.

### Estimated Storage Limits (2024)

| Browser | Desktop Limit (approx.) | Mobile Limit (approx.) | Notes |
| --- | --- | --- | --- |
| **Chrome** | 60% of free disk space | 6–10% of free disk (usually < 100MB) | Per origin; subject to user disk space |
| **Firefox** | 2GB per origin | 50MB–100MB (prompt at higher usage) | Uses a “Group” quota per site |
| **Safari** | 1GB (macOS), 50MB (iOS, strict) | 50MB–100MB (may auto-clear or block silently) | Private mode has 0 quota |
| **Edge (Chromium)** | Same as Chrome | Same as Chrome | Inherits Chromium behavior |
| **Opera** | Same as Chrome | Same as Chrome | Chromium-based |

> **Private/incognito mode**: Many browsers **disable** or severely **limit** IndexedDB (e.g., 0 quota in Safari private).

### How to Detect Storage Limits or Quota Warnings

There is **no direct API** to get the exact quota or usage **in all browsers**, but the most reliable methods are:

#### 1. Use `navigator.storage.estimate()` (Chrome, Edge, Firefox)

```javascript
if ('storage' in navigator && 'estimate' in navigator.storage) {
  const { quota, usage } = await navigator.storage.estimate();
  console.log(`Usage: ${(usage / 1024 / 1024).toFixed(2)} MB`);
  console.log(`Quota: ${(quota / 1024 / 1024).toFixed(2)} MB`);
}
```

- Works in Chromium & Firefox
- Safari **does not** support it
- Helps you **approximate** remaining space

#### 2. Catch `QuotaExceededError` During Writes

```javascript
try {
  await db.table('myTable').add(largeData);
} catch (err) {
  if (err.name === 'QuotaExceededError') {
    alert('Storage quota exceeded');
  }
}
```

- Works reliably in all browsers
- Not proactive; only tells you **after failure**

#### 3. Proactive Write Size Check (Custom Strategy)

You can **test how much you can write** with binary data:

```javascript
async function findLimit(db) {
  let size = 1024 * 1024; // Start with 1MB
  let max = 0;

  try {
    while (true) {
      const buffer = new ArrayBuffer(size);
      await db.table('test').put(buffer, size);
      max = size;
      size *= 2;
    }
  } catch (e) {
    console.log(`Max storable chunk: ${max / (1024 * 1024)} MB`);
  }
}
```

> Use this in a dev/test environment only, not production.

### Considerations

- Storage can be **evicted by the browser** (especially on mobile)
- Use `navigator.storage.persist()` to request **persistent storage** (won’t be cleared by the browser):

```javascript
const granted = await navigator.storage.persist();
console.log(granted ? "Persistent storage granted" : "Not granted");
```

### Recommendations

- **Regularly monitor** storage usage via `navigator.storage.estimate()`
- Request **persistent storage** if your app needs offline reliability
- Prepare for `QuotaExceededError` gracefully
- Limit user data usage with smart pruning, compression, and batching

## Answers

### Answer by ICSM Computer

IndexedDB storage limits vary by **browser**, **platform (desktop vs mobile)**, and **usage context (e.g., secure context, quota management)**. They are usually **quota-based**, often tied to available disk space.

### Estimated Storage Limits (2024)

| Browser | Desktop Limit (approx.) | Mobile Limit (approx.) | Notes |
| --- | --- | --- | --- |
| **Chrome** | 60% of free disk space | 6–10% of free disk (usually < 100MB) | Per origin; subject to user disk space |
| **Firefox** | 2GB per origin | 50MB–100MB (prompt at higher usage) | Uses a “Group” quota per site |
| **Safari** | 1GB (macOS), 50MB (iOS, strict) | 50MB–100MB (may auto-clear or block silently) | Private mode has 0 quota |
| **Edge (Chromium)** | Same as Chrome | Same as Chrome | Inherits Chromium behavior |
| **Opera** | Same as Chrome | Same as Chrome | Chromium-based |

> **Private/incognito mode**: Many browsers **disable** or severely **limit** IndexedDB (e.g., 0 quota in Safari private).

### How to Detect Storage Limits or Quota Warnings

There is **no direct API** to get the exact quota or usage **in all browsers**, but the most reliable methods are:

#### 1. Use `navigator.storage.estimate()` (Chrome, Edge, Firefox)

```javascript
if ('storage' in navigator && 'estimate' in navigator.storage) {
  const { quota, usage } = await navigator.storage.estimate();
  console.log(`Usage: ${(usage / 1024 / 1024).toFixed(2)} MB`);
  console.log(`Quota: ${(quota / 1024 / 1024).toFixed(2)} MB`);
}
```

- Works in Chromium & Firefox
- Safari **does not** support it
- Helps you **approximate** remaining space

#### 2. Catch `QuotaExceededError` During Writes

```javascript
try {
  await db.table('myTable').add(largeData);
} catch (err) {
  if (err.name === 'QuotaExceededError') {
    alert('Storage quota exceeded');
  }
}
```

- Works reliably in all browsers
- Not proactive; only tells you **after failure**

#### 3. Proactive Write Size Check (Custom Strategy)

You can **test how much you can write** with binary data:

```javascript
async function findLimit(db) {
  let size = 1024 * 1024; // Start with 1MB
  let max = 0;

  try {
    while (true) {
      const buffer = new ArrayBuffer(size);
      await db.table('test').put(buffer, size);
      max = size;
      size *= 2;
    }
  } catch (e) {
    console.log(`Max storable chunk: ${max / (1024 * 1024)} MB`);
  }
}
```

> Use this in a dev/test environment only, not production.

### Considerations

- Storage can be **evicted by the browser** (especially on mobile)
- Use `navigator.storage.persist()` to request **persistent storage** (won’t be cleared by the browser):

```javascript
const granted = await navigator.storage.persist();
console.log(granted ? "Persistent storage granted" : "Not granted");
```

### Recommendations

- **Regularly monitor** storage usage via `navigator.storage.estimate()`
- Request **persistent storage** if your app needs offline reliability
- Prepare for `QuotaExceededError` gracefully
- Limit user data usage with smart pruning, compression, and batching


---

Original Source: https://www.mindstick.com/interview/34337/what-are-indexeddb-s-storage-limits-across-different-browsers-platforms

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
