How to clean a keyboard and keyboard keys safely
Unplug it, shake out the crumbs, blow between the keys with compressed air and wipe the keys with 70 percent isopropyl alcohol on a cloth. Full steps inside.
- Takes 10 minutes, or 1 hour for a deep clean
- Laptop keyboards
- Mechanical keyboards
- Membrane desktop keyboards
- Apple Magic Keyboard
The short answer
Unplug the keyboard or shut down the laptop. Turn it upside down and tap it to shake out crumbs, then blow between the keys with short bursts of compressed air held upright. Wipe the keys with a microfiber cloth or cotton swab lightly dampened with 70 percent isopropyl alcohol. On mechanical keyboards, pull the keycaps and wash them in warm soapy water.
A keyboard collects crumbs, dust, skin oil and a surprising amount of bacteria. The good news is that a proper clean takes about 10 minutes and needs nothing more than compressed air, a microfiber cloth and 70 percent isopropyl alcohol. The two things to avoid are liquid running between the keys and prying keys off a laptop that were never meant to come off.
What you need
- A can of compressed air, or a soft brush if you do not have one
- A microfiber cloth
- 70 percent isopropyl alcohol and cotton swabs
- A keycap puller (mechanical keyboards only, usually included in the box)
- A bowl of warm water with a drop of dish soap (mechanical keycaps only)
Seventy percent alcohol is better than 99 percent for disinfecting, and it is gentle on keycap legends. Never pour anything directly on the keyboard, always put it on the cloth or swab first.
How to clean any keyboard (the quick clean)
This works for laptop, desktop membrane and mechanical keyboards without taking anything apart.
- Shut down the laptop, or unplug the keyboard. For a wireless keyboard, switch it off or remove the batteries.
- Turn the keyboard upside down over a trash can and tap the back firmly to shake out loose crumbs.
- Hold the compressed air can upright and blow between the keys in short bursts, working at an angle from one side of the keyboard to the other.
- Dampen a microfiber cloth or cotton swab with 70 percent isopropyl alcohol and squeeze it so it is not dripping.
- Wipe the top of every key, then run the swab around the edges of each key.
- Wipe the frame and the palm rest area.
- Let it air dry for a few minutes before turning the computer back on.
For a laptop, tilt it at roughly 75 degrees (almost upright) while you blow air across the keys, so debris falls out instead of deeper in. Apple recommends this angle for MacBook keyboards.
Warning: Never spray compressed air upside down or shaken. The propellant comes out as a freezing liquid that can damage plastic and electronics.
How to clean keyboard keys on a mechanical keyboard
Mechanical keyboards are the easiest to deep clean because the keycaps pop off.
- Unplug the keyboard.
- Take a photo of the layout so you know where every keycap goes back.
- Slide the keycap puller over a key, squeeze gently and pull straight up. Do not rock it side to side.
- Remove the large keys (space bar, Shift, Enter, Backspace) last and slowly. They have metal stabilizer wires, so lift them evenly.
- Put the keycaps in a bowl of warm (not hot) soapy water and let them soak for 20 to 30 minutes.
- While they soak, blow compressed air across the exposed plate and switches, then wipe the plate with an alcohol swab.
- Scrub the keycaps with a soft toothbrush, rinse them and spread them on a towel.
- Let the keycaps dry completely, ideally overnight, before putting them back.
- Press each keycap straight down onto its switch until it clicks into place.
Hot water can warp ABS keycaps, so keep it warm. Keycaps must be totally dry before you refit them, since trapped water can run down into a switch.
How to clean a laptop keyboard
Laptop keys are attached with tiny plastic clips (scissor switches) that break easily. Unless your manufacturer documents how to remove them, leave the keys on and use the quick clean above. Compressed air plus an alcohol swab run around each key removes almost everything.
If a single key feels crunchy or stuck, see our guide on how to fix sticky keyboard keys, which covers when it is worth lifting one key and how to do it without snapping the clips.
While the laptop is off, it is a good time to clean the laptop screen too. Keyboard oils transfer to the display every time you close the lid.
What to do if you spill something on your keyboard
Speed matters more than anything here.
- Turn off the laptop immediately by holding the power button, or unplug the keyboard.
- Unplug the laptop charger.
- Turn the laptop or keyboard upside down, in a tent shape for a laptop, so liquid drains out through the keys rather than toward the board.
- Blot what you can with a paper towel. Do not wipe, which spreads liquid around.
- Leave it upside down to dry for at least 24 to 48 hours in a warm, dry room.
- Only then turn it on and test every key.
Water is the least harmful spill. Coffee, soda and juice leave sugar and acid behind that makes keys sticky or corrodes contacts, even after the liquid dries. For a laptop hit by a sugary drink, a professional clean is often worth it.
Do not put the laptop in a bag of rice. Rice absorbs very little moisture from inside a sealed device, it does nothing about sugar residue, and rice dust and starch can end up in the keyboard and ports. Open air, upside down, is better. On a desktop keyboard, a spill of plain water usually dries out fine. A sugary spill on a membrane keyboard is often cheaper to solve by replacing the keyboard.
Cleaning do and don’t
| Do | Don’t |
|---|---|
| Use 70 percent isopropyl alcohol on a cloth or swab | Pour or spray liquid on the keyboard |
| Hold compressed air upright, in short bursts | Tilt the can or spray it upside down |
| Remove mechanical keycaps with a puller | Pry laptop keys off with a knife or screwdriver |
| Wash keycaps in warm soapy water | Use hot water, bleach or the dishwasher |
| Let everything dry completely | Use a hair dryer on high heat |
When a keyboard needs repair
If keys stop registering after cleaning, several keys in a row fail together, or a key repeats on its own, the issue is likely electrical rather than dirt. On a laptop, that usually means a keyboard replacement by the manufacturer or a repair shop. On a mechanical keyboard with hot swappable switches, you can pull and replace the single bad switch yourself.
Clean the rest of your desk
Your keyboard is rarely the only dirty thing on the desk. Once it is done, follow our guide to clean a monitor without damaging the coating, and do not forget the surface your hand rests on all day: here is how to clean a mouse pad. If you use earbuds at the desk too, cleaning your earbuds takes about five minutes.
Questions people ask
Can I clean keyboard keys with disinfecting wipes?
Yes, as long as the wipe is not dripping. Squeeze out excess liquid first so nothing runs between the keys, and avoid wipes containing bleach. A 70 percent isopropyl alcohol wipe is the safest choice. Apple also lists Clorox Disinfecting Wipes as acceptable on hard surfaces of its keyboards.
How often should I clean my keyboard?
A quick wipe of the keys once a week and a shake plus compressed air once a month is plenty for most people. If you eat at your desk or share the keyboard, wipe it every few days. Mechanical keyboards benefit from a full keycap wash two or three times a year.
Can I put a keyboard in the dishwasher?
No. The heat, water pressure and detergent can damage the circuit board and warp plastic, and even 'waterproof' keyboards are not designed for a dishwasher cycle. Only the removed keycaps of a mechanical keyboard should get wet, and hand washing in a bowl is safer than the dishwasher for those too.
How do I clean a keyboard without compressed air?
Turn the keyboard upside down and tap it firmly, then run a soft, clean paintbrush or a dry toothbrush between the keys. A handheld vacuum with a brush attachment works too, as long as you hold it over the keys without sucking up keycaps. Finish with a damp alcohol swab around each key.