Cleaning a keyboard is simple if you use the right method. Turn off or unplug the keyboard, remove loose dust and debris, then wipe the keys with a lightly dampened lint-free cloth. Never spray liquid directly onto the keyboard.

What You Need
- Microfiber or lint-free cloth
- Compressed air
- Cotton swabs
- Mild soap and water
- Up to 70% isopropyl alcohol for compatible keyboards
- A soft brush, if needed
How to Clean a Keyboard
1. Turn Off and Unplug the Keyboard
Disconnect a wired keyboard from your computer before cleaning it. If you use a wireless keyboard, turn it off and remove its batteries if possible. This reduces the risk of electrical problems while you clean.
For a laptop, shut the computer down completely before starting.
2. Remove Loose Dirt
Hold the keyboard upside down and gently tap it to loosen crumbs, dust, hair, and other debris. Don’t shake it aggressively because you could damage internal components. Microsoft recommends this as the first step for removing loose debris.
3. Use Compressed Air
Compressed air is useful for removing dust trapped between the keys. Spray across the keyboard rather than forcing air directly into one spot.
If you’re cleaning a MacBook keyboard, Apple recommends holding the laptop at about a 75-degree angle and using compressed air from side to side. Keep the straw roughly 1.5 cm from the keyboard and never turn the can upside down while spraying.
4. Brush Away Remaining Dust
Use a soft brush to loosen particles that remain around the key edges. A small electronics-cleaning brush works well.
You can also gently vacuum the top of some keyboards with a dusting-brush attachment, which Microsoft lists as an alternative to compressed air.
5. Wipe the Keys
Lightly dampen a lint-free cloth with mild soapy water and wipe the keyboard surface and keycaps. The cloth should be damp, not wet.
Do not pour, spray, or drip liquid directly onto the keyboard. Moisture getting underneath the keys can cause electrical or mechanical problems.
For compatible keyboards, a soft cloth lightly dampened with an isopropyl alcohol solution of 70% or less can also be used.
6. Clean Around Individual Keys
For dirt around individual keys, use a slightly damp cotton swab. Work around the edges without pushing debris farther underneath the keycaps.
If a keycap is removable, check the keyboard manufacturer’s instructions before taking it off. Laptop key mechanisms can be particularly delicate, so don’t pry them off without knowing how they’re designed.
7. Let the Keyboard Dry
Allow the keyboard to dry completely before reconnecting or turning it on. Make sure there is no visible moisture around the keys or openings.
How Often Should You Clean a Keyboard?
For a regularly used keyboard, a quick cleaning once a month is a reasonable routine. Microsoft recommends cleaning its keyboards monthly or whenever needed.
A deeper cleaning may be necessary sooner if you eat at your desk, work in a dusty environment, or notice sticky or unresponsive keys.
How to Clean a Sticky Keyboard
Sticky keys usually require more attention than ordinary dust.
- Turn off and unplug the keyboard.
- Remove loose debris with gentle tapping.
- Use compressed air around the affected key.
- Wipe the key and surrounding area with a lightly dampened lint-free cloth or cotton swab.
- For compatible devices, use a small amount of up to 70% isopropyl alcohol on the cloth rather than applying it directly.
- Allow the keyboard to dry completely before testing it.
If a key remains stuck or stops responding after cleaning, the problem may be mechanical rather than simply dirt-related.
What Not to Do When Cleaning a Keyboard
Avoid these common mistakes:
- Don’t spray water or cleaner directly onto the keyboard.
- Don’t pour liquid between the keys.
- Don’t clean while the keyboard is powered on.
- Don’t soak the cloth.
- Don’t use aggressive household chemicals unless the manufacturer specifically approves them.
- Don’t force laptop keycaps off.
- Don’t turn a compressed-air can upside down while spraying.
Microsoft specifically advises disconnecting the keyboard before cleaning and avoiding direct application of liquids.
How to Clean a Laptop Keyboard
Laptop keyboards need extra care because their components are built directly into the computer.
Shut down the laptop first. Hold it at a suitable angle and use short, controlled bursts of compressed air to remove debris. Apple specifically recommends a roughly 75-degree angle and side-to-side compressed-air passes for certain MacBook and MacBook Pro keyboards.
After removing the dust, wipe the keys with a barely damp lint-free cloth. Keep moisture away from openings and never spray cleaning products directly onto the laptop.
How to Keep Your Keyboard Clean
The easiest way to keep a keyboard clean is to prevent heavy buildup in the first place.
- Avoid eating directly over the keyboard.
- Wash and dry your hands before long typing sessions.
- Remove visible dust regularly.
- Wipe frequently touched keys when necessary.
- Keep drinks away from the keyboard.
- Perform a deeper cleaning about once a month.
Regular light cleaning is much easier than trying to remove months of accumulated grime.