What is the LOCALSTORAGE file format?
A .localstorage file is the on-disk database a web browser creates to implement HTML5 Web Storage (localStorage) - a key-value store that lets websites persist data between sessions. LOCALSTORAGE files perform a similar function to cookies, although the Web Storage specification defines a broader and more capable set of storage operations.
LOCALSTORAGE file uniqueness
Data stored in LOCALSTORAGE files is not deleted when the browser closes. Such data is saved on the user's computer; the web server has no automatic access to it. LOCALSTORAGE data can only be read and written via JavaScript by the same domain that created it, providing origin isolation. LOCALSTORAGE files are typically larger than cookie files.
Which web browsers use LOCALSTORAGE files?
LOCALSTORAGE is supported by all modern browsers. Early support arrived around 2008-2009 in Chrome 4, Firefox 3.5, Safari 4, Opera 10.5, and Internet Explorer 8. Mobile support followed in Android Browser and iOS Safari.
Size limits
The HTML5 spec recommends a 5 MB per-origin limit. Desktop browsers typically allow:
- 5 MB in Safari,
- 10 MB in Chrome and Firefox.
Mobile browsers generally enforce a tighter 2-5 MB limit per origin.
Storage format
Older WebKit-based browsers (Safari and early Chrome) stored LOCALSTORAGE data as a SQLite database with an ItemTable mapping keys to values. Google Chrome migrated its localStorage backend from SQLite to LevelDB around Chrome 28 (2013) - modern Chrome keeps these files in a leveldb/ subfolder under Local Storage in the user profile. Some Electron apps and older Chromium-based browsers still write .localstorage SQLite files.
Security & safety
RISK: LOW.localstorage files are passive SQLite databases containing website data (preferences, session tokens, cached values). They may contain sensitive data such as session tokens or personal information stored by websites. Do not share or expose these files. Deleting them clears localStorage for the affected origin (you may be logged out of websites).
Format details
in a nutshellPrograms that open LOCALSTORAGE files
Technical details
deep spec| Container (WebKit/Safari/older Chrome) | SQLite 3 database file |
| SQLite magic bytes | `SQLite format 3` + NUL (hex 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00) at offset 0 |
| Internal SQLite table | `ItemTable (key TEXT, value TEXT)` - one row per localStorage key-value pair; one database file per origin |
| Per-origin isolation | One file per origin (scheme + host + port); cross-origin access is blocked by the browser same-origin policy |
| Storage limit | 5 MB per origin (HTML5 recommendation); desktop browsers enforce 5-10 MB in practice |
| Data persistence | Data survives browser close and OS restart; cleared only by explicit site script or user action in browser settings |
| JavaScript API | Read/write exclusively via `localStorage.getItem()` / `localStorage.setItem()`; no direct file-level access by web pages |
| Encryption | None; all stored values are plaintext in the SQLite database or LevelDB entries |
| Chrome backend migration | Chrome switched localStorage from SQLite (.localstorage files) to LevelDB around Chrome 28 (2013); modern installs use LevelDB |
| Chrome file location (Windows) | `%LOCALAPPDATA%\Google\Chrome\User Data\Default\Local Storage\leveldb\` |
| Safari file location (macOS) | `~/Library/Safari/LocalStorage/` - one SQLite `.localstorage` file per origin |
| Electron apps | Many Electron-based desktop apps still write SQLite `.localstorage` files in their per-app user data directory |
| Released | 2008 (WebKit/Safari 4 beta; Chrome 1.0) |
| Open standard | Yes · royalty-free |
| Specification | html.spec.whatwg.org |
Community Q&A
asked by usersNo questions yet - be the first to ask about LOCALSTORAGE files.