How to Clean a Keyboard: Full Guide for Every Type — Mechanical, Laptop, and Membrane

Keyboards are among the dirtiest surfaces in any home or office — studies have found keyboards harbor up to 400 times more bacteria than a toilet seat, including E. coli, Staphylococcus aureus, and cold and flu viruses. Crumbs, skin oils, dead skin cells, and dust accumulate under and around keycaps daily. This guide covers quick surface cleaning, deep cleaning with keycap removal, laptop keyboard-specific methods, and what to do if you spill liquid on a keyboard.

What You’ll Need

TaskSupplies
Quick cleaningCompressed air can, microfiber cloth, 70% isopropyl alcohol wipes or solution
Routine cleaningCotton swabs, soft-bristle brush (makeup brush or dedicated keyboard brush), toothpick
Deep cleaning (keycap removal)Keycap puller (or two paper clips bent into a U-shape), small bowl, dish soap, warm water, microfiber cloth
Laptop keyboardCompressed air, barely-damp microfiber cloth, cotton swabs with isopropyl alcohol
Liquid spill recoveryClean dry cloths, silica gel packets or uncooked rice, screwdriver (for full disassembly if needed)

Safety Precautions

  • Unplug wired keyboards before cleaning. For USB keyboards, disconnect from the computer. For wireless keyboards, turn the power switch off and remove batteries before any wet cleaning.
  • Never spray liquid directly onto the keyboard. Spray cleaning solution onto a cloth or cotton swab, then apply to the keyboard. Direct spraying forces liquid beneath keys and into the circuit layer.
  • Use only 70% isopropyl alcohol — not household cleaners, bleach, or ammonia-based products. These can damage key legends (the printed letters) and the plastic housing.
  • For laptop keyboards: extreme caution. Laptop keyboards are directly connected to the motherboard — liquid that gets beneath the keys can reach and permanently damage the mainboard. Be especially conservative with moisture on laptops.
  • Let everything dry completely before reconnecting. After any wet cleaning, allow at least 30 minutes of air drying before plugging a keyboard back in or turning a laptop on.

How Often Should You Clean Your Keyboard?

Cleaning TypeFrequency
Shake out / compressed air blastWeekly
Surface wipe with isopropyl alcoholWeekly (daily during flu season)
Cotton swab around individual keysMonthly
Full deep clean with keycap removalEvery 3–6 months for desktop keyboards
Laptop keyboard surface cleanMonthly

Quick Keyboard Cleaning: Step-by-Step (5 Minutes)

Step 1: Disconnect and Power Off

Unplug USB keyboards from the computer. For wireless keyboards, flip the power switch to OFF and remove batteries. Shut down and unplug laptop keyboards before cleaning. This prevents accidental key presses that could affect your work and eliminates any electrical risk from moisture.

Step 2: Turn Upside Down and Shake

Hold the keyboard upside down at about a 45-degree angle and shake firmly over a trash can or paper towel. You’ll be surprised how much debris falls out — crumbs, hair, and dust are the main culprits. Tap the underside a few times while shaking to dislodge stubborn debris from underneath keys.

Step 3: Compressed Air Blast

Use a can of compressed air with the keyboard tilted at an angle (not flat). Blast air between and around keys using short 1–2 second bursts. Work in rows, left to right. Keep the can upright to prevent liquid propellant from spraying out. The compressed air blows out debris that shaking didn’t dislodge, especially from the spaces between keycaps. Pay extra attention to the spacebar area, which accumulates the most debris.

Step 4: Wipe Keycap Surfaces

Dampen a microfiber cloth with 70% isopropyl alcohol — just barely damp, not wet. Wipe each keycap top, pressing gently to reach the slightly recessed center of each key. Work across the keyboard methodically. The alcohol kills bacteria, removes oils, and evaporates quickly without leaving residue or damaging the plastic or printed legends.

Step 5: Cotton Swab the Gaps

Dip a cotton swab in 70% isopropyl alcohol and run it around the edges of each key — in the gap between the keycap and the keyboard body. This removes the greasy buildup that accumulates at the key edges. Replace cotton swabs as they become visibly dirty. For particularly tight gaps, a toothpick run dry around the key edge first can dislodge hardened debris before the alcohol swab follows.

Deep Cleaning a Mechanical Keyboard: Keycap Removal

Mechanical keyboards allow full keycap removal for the most thorough cleaning possible. This is the method to use when keys look grimy, feel tacky, or when visible buildup under the keys needs to be addressed.

Step 1: Photograph Your Layout First

Before removing any keys, take a clear photo of the full keyboard from directly above. This is your reference map for reassembly — it’s very easy to forget the position of less-common keys like F-row, navigation cluster, and modifier keys when they’re all in a pile.

Step 2: Remove Keycaps

Use a keycap puller (a small wire tool included with most mechanical keyboards, or available for $5–$8 online). Hook the wire under opposite corners of the keycap and pull straight up with even pressure. Do not yank at an angle — this can damage the switch stem. For large keys like the spacebar, Enter, and Shift, pull from the center — these keys have stabilizer bars that require straight upward pressure to disengage.

If you don’t have a keycap puller, carefully use two bent paper clips or a flat tool, but apply pressure slowly and evenly to avoid cracking keycaps.

Step 3: Wash the Keycaps

Place all removed keycaps in a bowl or colander. Fill with warm (not hot) water and a few drops of dish soap. Let soak for 30–60 minutes to loosen grime. Swish and gently rub each keycap between your fingers. Rinse thoroughly under warm running water until no soap remains. Lay on a clean microfiber towel and allow to air dry completely — at least 4–6 hours — before reassembly. Do not use hot water, as it can warp thin keycaps.

Step 4: Clean the Keyboard Body and Switch Area

With keycaps removed, use compressed air to blast the switch area. Then use cotton swabs dipped in isopropyl alcohol to clean around each switch stem, along the PCB plate edges, and any visible buildup areas. A soft brush (makeup brush or dedicated keyboard cleaning brush) helps reach the plate surface between switch stems. Allow to air dry before reattaching keycaps.

Step 5: Reassemble

Press each keycap straight down onto its switch stem until you hear/feel a click. Use your layout photo to reference placement. Test all keys after reassembly by typing in a text editor to confirm every key registers correctly.

How to Clean a Laptop Keyboard

Laptop keyboards require more caution than external keyboards because the keys are integrated directly into the body, and moisture can easily reach the motherboard beneath. Never remove laptop keycaps unless you are experienced with laptop disassembly — they are far more fragile than mechanical keyboard keycaps and use very different mounting mechanisms.

  1. Shut down the laptop completely and unplug the power adapter before cleaning.
  2. Tilt at 45–75 degrees and use compressed air in short bursts along each row of keys, working left to right. This dislodges the vast majority of debris that falls into laptop keyboards.
  3. Wipe keycap surfaces with a microfiber cloth barely dampened with 70% isopropyl alcohol. Use extremely light moisture — one pass only. Dry immediately with a dry section of the cloth.
  4. For the gaps around keys, use a cotton swab with a minimal amount of isopropyl alcohol. Be conservative — laptop keyboard gaps lead directly to the motherboard area.
  5. For Apple MacBook keyboards (especially older butterfly switch models): Apple specifically recommends compressed air only at specific angles. Check Apple’s support documentation for your exact model before applying any liquid to these sensitive keyboards.

Cleaning Membrane Keyboards

Membrane keyboards (the standard, non-mechanical desktop keyboard type) cannot have keycaps removed safely in most cases — they are attached differently than mechanical switch keycaps. Clean membrane keyboards using the quick cleaning method (shake, compressed air, alcohol wipe, cotton swabs) and do not attempt to pry off individual keys. Some membrane keyboards have removable key covers that can be gently lifted from the spacebar and Enter key, but individual alphanumeric keys are generally not designed to be removed.

What to Do If You Spill Liquid on a Keyboard

Speed matters. The faster you act after a liquid spill, the better the chance of saving the keyboard.

  1. Immediately disconnect the keyboard. Rip the USB cable out or turn off wireless keyboards within seconds of the spill. For laptops: shut down immediately (hold power button), disconnect the charger, and remove the battery if possible.
  2. Turn upside down immediately to drain as much liquid as possible. Keep it upside down for at least 1–2 minutes.
  3. Blot — do not wipe. Use a dry cloth to blot the exterior. Wiping forces liquid inward.
  4. Remove keycaps (on mechanical keyboards) and use cotton swabs to carefully absorb any liquid that reached the switch area.
  5. Place in a dry, warm area with good airflow. Do not use a hair dryer — the heat damages components. A bag of silica gel packets around (not touching) the keyboard accelerates drying. Leave for 24–72 hours minimum before attempting to use.
  6. For sugary liquid spills (juice, soda, coffee with sugar): the residue will cause sticking keys even after drying. Full disassembly and isopropyl alcohol cleaning of the switch area is likely needed for mechanical keyboards. For membrane keyboards, the sticky residue often renders them non-recoverable — a replacement is usually more practical.

Keyboard Cleaning by Type: Quick Reference

Keyboard TypeKeycap RemovalBest Cleaning MethodSpill Recovery
Mechanical (desktop)Yes — safe with keycap pullerFull deep clean with keycap soakGood (if disconnected immediately)
Membrane (desktop)Not recommendedCompressed air + surface alcohol wipeModerate (plain water ok, sugary drinks often fatal)
Laptop keyboardNo (fragile, not designed for removal)Compressed air + light alcohol wipe onlyPoor — immediate shutdown critical
Apple Magic KeyboardNoCompressed air + barely damp cloth onlyGood (sealed design)
Wireless BluetoothDepends on typeSame as keyboard type + remove batteries firstRemove batteries immediately

Pro Tips for a Cleaner Keyboard Longer

  • Stop eating at your keyboard. The most effective keyboard cleaning tip is preventive — food crumbs and sticky fingers are the primary source of keyboard contamination. If you must eat at a desk, a keyboard cover (silicone skin) protects the keys.
  • Wash hands before typing. A quick handwash before sitting at a keyboard dramatically reduces the oil and bacteria transferred per session.
  • Keep a can of compressed air at your desk. A 5-second blast weekly prevents crumb accumulation from becoming a problem.
  • Use an antimicrobial keyboard cover for shared or public computers — they can be removed, washed, and disinfected independently of the keyboard.

Troubleshooting

Keys Are Sticky After Cleaning

Sticky keys after cleaning usually mean residue was pushed into the switch mechanism rather than removed. On mechanical keyboards, remove the affected keycap, clean around the switch stem with an isopropyl-dampened swab, and let dry completely. On membrane keyboards, try blotting the key area with a cotton swab soaked in isopropyl alcohol and pressing the key repeatedly to distribute the alcohol into the switch layer.

Key Doesn’t Register After Cleaning

A key that stops registering after cleaning usually means moisture reached the contact layer. Disconnect the keyboard and let dry for 24–48 hours. If the key still doesn’t register, the contact membrane beneath may be damaged — on mechanical keyboards, the switch can be replaced. Membrane keyboards typically cannot be repaired at the switch level.

Frequently Asked Questions

Can I use rubbing alcohol to clean my keyboard?

Yes — 70% isopropyl alcohol (rubbing alcohol) is the best cleaning solution for keyboards. It kills bacteria, evaporates quickly, doesn’t leave residue, and is safe for all keyboard plastics and key legends. Use 70% — not 90%+ concentrations, which evaporate too fast to clean effectively and can cloud some plastics.

Can I wash keyboard keycaps in the dishwasher?

For plastic (ABS or PBT) keycaps without double-shot or pad-printed legends: a dishwasher top-rack cycle on cold water only is technically possible but not recommended. The water pressure and heat can damage thin keycaps and fade legends. Hand washing in a bowl of warm soapy water is safer and equally effective.

How do I clean under the spacebar without removing it?

Use compressed air angled underneath the spacebar from multiple sides. A long cotton swab (or a regular swab bent slightly) can reach further under the spacebar than standard keys allow. For deep cleaning the spacebar area on mechanical keyboards, the spacebar can be removed (pull carefully from the center, at both ends simultaneously) — the stabilizer bars make it slightly more complex than standard keys, but it is removable.

Is it safe to clean a gaming keyboard the same way?

Yes — gaming mechanical keyboards (Corsair, Razer, Logitech, SteelSeries, etc.) all use the same keycap removal and cleaning approach as standard mechanical keyboards. The only difference is that RGB LED keyboards should have keycaps only air-dried, not placed in direct strong sunlight, to protect the LED color in the switch housing over time.

My keyboard has UV coating — can I use alcohol?

Some premium keyboards have UV-coated or oil-resistant keycap coatings. 70% isopropyl alcohol is generally safe for these, but test on a single key first (like a rarely-used function key) and check that the finish isn’t affected after drying. If the coating dulls, switch to a dry microfiber cloth-only cleaning approach and reserve alcohol for the keyboard body only.

Conclusion

Cleaning a keyboard takes under 10 minutes for a routine clean and 30–45 minutes for a full deep clean — and the results in terms of hygiene, typing feel, and key responsiveness are significant. The core method is consistent regardless of keyboard type: disconnect, compressed air, isopropyl alcohol wipe, cotton swabs for gaps. Add keycap removal for mechanical keyboards every few months and you’ll have a genuinely clean, well-maintained keyboard that performs better and lasts longer.

For your other desk electronics, our guides on how to clean remote controls and how to clean a phone screen cover the full range of high-touch tech devices. For a complete home cleaning plan, see our cleaning schedule template.

Steve Davila

About the Author

I'm Steve Davila, founder of GuideGrove. I started this site after years of running into home cleaning and DIY guides that skipped the important steps or assumed too much. Every guide here is written the way I wished I'd found it — with the full process, the common mistakes, and the details that actually make the difference.

Connect: Email | About Me

Leave a Comment