How does a computer remember things even after you turn it off?
After you watchHow does a computer remember things even after you turn it off?
The short answer
A computer remembers things after you turn it off because it has two different kinds of memory. Working memory (RAM) only holds a bit while electricity is flowing, so it forgets the instant the power goes. Storage (flash or a hard disk) locks each bit into a physical state that needs no power, so your saved files are still there when you switch the computer back on.
Try this next
- What if you keep pulling the plug over and over before the note reaches storage? Write the note, then yank the power at different moments. Predict first: is there a moment after which working memory still scatters but storage already holds it?
- What if you only write into storage and never into working memory? Push the note straight to the storage bank and skip the RAM bank. Predict whether it survives the plug-pull, then check why the computer bothers with fast memory at all.
Now you — bend it
- What if In the lab you pull the plug and working memory scatters to blank. What if the power only blinked off for a few thousandths of a second instead of for good — does the note survive that flicker?DRAM bits are tiny capacitors that leak charge in milliseconds, so the chip secretly re-tops them up thousands of times a second. Predict whether a blink shorter than one refresh cycle gets caught and re-charged before the bits fade — and why the computer can't trust that.
- What if You write the same note into both banks at once. What if you wrote a note so long it filled the working-memory grid but the storage bank still had room to spare — which bank runs out first?Storage packs far more bits per chip than working memory because each stored bit is a single locked state, not a powered, refreshed cell. Predict which bank you'd overflow first, and what that says about why your phone has gigabytes of storage but less working memory.
- What if Storage 'wins' the plug-pull every time here. What if you saved to the same flash bank ten thousand times over and over — does it keep winning forever?Each flash cell is worn a little every time it's rewritten, and after roughly thousands to a hundred thousand writes a cell can stop holding its trapped charge. Predict whether 'lasting with no power' also means 'lasting through unlimited rewrites' — they're not the same promise.
Can you prove it?The note vanishing from working memory isn't random damage from the plug-pull — it's that those bits were only ever being held up by power, so cutting power alone is enough to erase them. — Run the lab twice with the same note. First, pull the plug and watch working memory scatter while storage holds. Then plug back in, re-write the note, and pull the plug again — it scatters the exact same way every time, while storage never loses it. A clean, repeatable wipe that happens the instant power drops (not from heat, shaking, or wear) is the fingerprint of a volatile, power-held bit; storage's untouched copy proves the plug-pull itself did no damage.
Design your own test:Before you test it, predict: does a longer note make working memory forget faster, slower, or exactly the same when the power drops — and does the number of bits change anything about whether storage keeps it?
Explain it to a 6-year-old: One kind of computer memory is like holding a balloon up with your breath — let go and it drops; the other is like a sticker stuck on the wall that stays even when you walk away.
The whole story
How it works
Everything a computer remembers is stored as tiny bits, each one simply on or off, a 1 or a 0. In working memory each bit is held up by flowing electricity, so the moment power stops the bits lose their charge and the memory wipes blank. In storage each bit is snapped into a lasting physical state instead, such as a trapped charge in flash memory or a magnetic spot on a disk, and that state stays without any power. When you press save, the computer copies your work from the fast forgetful working memory into the slow lasting storage, which is why it survives being switched off.
What people get wrong
People often think a computer remembers in one single way, so pulling the plug must either erase everything or nothing. In fact a computer uses two kinds of memory that behave in opposite ways: working memory forgets the instant power is cut, while storage keeps its bits with no power at all. That split is exactly why unsaved work vanishes in a crash but saved files come right back.
The catch
Working memory is lightning fast, so the computer can think and juggle everything you are doing this second straight out of it, but it forgets everything the moment the power blinks. Storage keeps your files safe forever with no power, but it is much slower, so the computer must copy things from storage onto the fast working memory before it can really work with them.
Questions kids ask
Why does my work disappear if the computer crashes before I save?
While you are working, your changes live in fast working memory, which only holds them as long as power is flowing. If the computer crashes or loses power before you save, that memory wipes blank. Saving copies your work into storage, which keeps it with no power, so saved work survives a crash.
If storage keeps things without power, why not use it for everything?
Storage is much slower than working memory. The computer needs a fast place to think and juggle what you are doing right now, so it uses speedy working memory for that and copies finished work down into slower, lasting storage to keep it safe.
Does a phone work the same way?
Yes. Phones, tablets, game consoles and laptops all have fast working memory that forgets when power is cut and lasting storage that keeps your photos, apps and files when the device is off. It is the same two-kinds-of-memory idea in every one of them.
Why does turning a frozen computer off and on again fix things?
Restarting wipes the fast working memory clean, clearing out whatever got tangled up there, and then reloads a fresh copy from storage. Your saved files are untouched because they live in the lasting storage, which the power cut never erases.
Talk about it
- Guess first: when you save a game and the battery dies, which of the two memories saved you?
- Why do you think a computer keeps a fast forgetful memory at all instead of just using the lasting one?
- Where in our house is something that remembers with power and something that remembers without it?
For grown-ups
Working memory is volatile DRAM: each bit is a tiny capacitor that leaks charge and must be refreshed thousands of times a second by power, so it clears the instant power is lost. Storage is non-volatile: flash memory traps electrons on an insulated floating gate, and a hard disk flips magnetic regions on a spinning platter, both holding their state with zero power. Saving copies data from volatile RAM into non-volatile storage, which is why unsaved work disappears in a crash while saved files persist.
Keep going
What else makes you wonder?
- If working memory forgets the second the power blinks, how does a computer remember anything at all during a tiny flicker?
- How does the computer decide what is worth copying down into slow storage and what it can just throw away?
- Your brain remembers some things for seconds and some for years — does it have two kinds of memory too?