What is IndexedDB and when do websites use it?

Home / Everything About / Everything About Websites / What is IndexedDB and when do websites use it?

IndexedDB is the browser's built-in storage system for large, structured data. Learn what it is, how it works, and when websites use it instead of local or session storage.

Have you ever used a web app that kept working even when your internet dropped? Or one that felt as fast as a native app installed on your phone, with large amounts of data loading instantly? Behind those experiences is usually something far more capable than the basic browser storage tools we have covered so far. That something is IndexedDB.

IndexedDB is the most capable browser storage type available, and it sits at a level above what local storage and session storage were designed to handle. Most business website owners will never interact with it directly, but understanding it gives you a complete picture of what browsers are capable of storing.

What is IndexedDB?

IndexedDB is a low-level database built into the browser. Unlike local storage and session storage, which store simple key-value pairs of text, IndexedDB can store structured data: objects, arrays, files, and binary data. It is searchable, indexable, and capable of storing far more data than the other browser storage types.

The name gives you a clue about how it works. It uses indexes, which are like lookup tables, to find stored records quickly without having to search through everything. This makes it practical for storing and retrieving large amounts of structured information inside the browser itself.

How does IndexedDB differ from other browser storage?

Local storage stores small text values and keeps them indefinitely. Session storage does the same but only for the current tab session. Both are simple and limited. IndexedDB is fundamentally different in scope and capability.

Storage capacity is one of the main differences. While local storage is typically capped at 5 to 10 megabytes, IndexedDB can store hundreds of megabytes or more depending on the browser and the device. It also stores complex data structures directly, not just plain text. And it supports queries, meaning the website can search and filter stored records rather than just retrieving a value by its exact key.

What do websites use IndexedDB for?

Offline functionality

Web apps that need to work without an internet connection use IndexedDB to store data locally on the device. A note-taking app, a project management tool, or an email client can save records in IndexedDB so the visitor can still read, create, and edit content even when offline. The changes sync back to the server once the connection is restored.

Large datasets in the browser

Applications that work with large amounts of data, like maps, complex filters, or large product catalogs, can use IndexedDB to cache that data locally. This reduces how often the app needs to fetch data from the server and makes the experience significantly faster for the user.

File storage

IndexedDB can store files directly in the browser. This makes it useful for apps where users upload or generate content that needs to be accessible across sessions before it is sent to the server.

Do most websites use IndexedDB?

No. IndexedDB is used by complex web applications, not by typical business websites. A marketing site, a service website, an online store, and most content-driven sites have no need for it. Their storage needs are well covered by cookies, local storage, and session storage.

For your own website, the platform you build on handles all storage decisions. WEMASY's website builder uses the right storage type for each feature automatically. For a side-by-side view of all browser storage types and how they fit together, read types of browser storage.

Frequently asked questions

Is IndexedDB a real database?

How much data can IndexedDB store?

Does IndexedDB data persist after the browser closes?

Is IndexedDB secure?

Can visitors clear their IndexedDB data?

Do I need to know about IndexedDB to build a website?