Glossary
What is Local storage?
Published Updated
Also known as: localStorage, browser storage.
It’s the simplest way for an app to remember things. It needs no account, no server and no setup. A to-do list, a game’s high score or a light/dark theme choice can all live there.
What local storage keeps, and for how long
According to MDN, the web’s reference documentation, what an app saves in local storage stays there after you close the browser, and it has no expiration time. It only goes away when something deletes it: you clearing the browser’s data, the app itself, or a private window closing.
Three limits matter when you build with AI:
- It belongs to one browser on one device. What you saved on your computer doesn’t appear on your phone, or in another browser on the same computer.
- It belongs to one address. The browser keeps a separate space for each site address, and
http://andhttps://count as different addresses. If the address changes, for example when you move from a test address to a custom domain, the new address starts empty. - It saves only text, and not much of it. Keys and values are text. MDN says browsers can store up to 5 MiB of local storage per site, which is plenty for a list or a setting and far too little for photos or files.
Why saved data disappears
If your data disappeared or doesn’t show up on another device, check these causes first:
- You opened the app on another device, browser or address.
- You cleared the browser’s data or cookies. MDN says that if you block cookies, browsers will probably also stop pages from saving data.
- You were in a private (incognito) window. MDN says local storage there is cleared when the last private tab is closed.
MDN also says browsers treat site data as “best-effort”: it can be deleted if the device runs out of space, though the Chrome team’s research it cites shows this is very rare for sites you visit regularly.
Is local storage enough for your app?
It’s enough when only you use the app, on one device, and losing the data wouldn’t hurt. A personal checklist or a practice game fits.
It’s not enough when the same information must appear on your phone and your computer, when other people use the app, or when it holds orders, customers or anything you can’t afford to lose. For that you need a database, which keeps the data on a server instead of in one browser. Don’t save passwords or API keys in local storage either: see how to keep API keys safe.
How to find out where your app saves data
Add an item in the app, then open the app’s address in a private window or another browser. If you have to log in, log in. If the item is missing, the app is probably keeping it only in that first browser.
You can also ask the AI, without changing anything:
Where does this app save the data people enter: in the browser (localStorage) or in a database? List which screens save what, in plain language, and don't change any code.
If it says local storage and you need the data on more than one device, the prompts page has a ready prompt for moving the data online. If you see the error localStorage is not defined, that’s a different problem: see localStorage is not defined.
Sources, checked on November 13, 2026: MDN, Window: localStorage property and Storage quotas and eviction criteria.