The safest way to clean a Mac keyboard
Turn off your Mac and unplug it from power before you start. If you have a wireless keyboard, turn it off too. Shut down completely rather than putting it to sleep — you want no power running through the device while you work on it.
Use compressed air as your first step. Hold the can upright, aim the nozzle at a shallow angle across the keys, and use short bursts. Tilt your keyboard so debris falls away from the machine. Do this over a trash can or outside. Compressed air dislodges dust, crumbs, and hair that sit between and under the keys without requiring you to touch anything.
For visible grime on the keycaps themselves, dampen a microfiber cloth with distilled water — not tap water, which leaves mineral deposits. Wring it out so it is barely damp, not wet. Wipe each key gently. Do not let water drip into the keyboard. If you see liquid pooling anywhere, stop and let it dry for several hours before powering on.
Key Takeaways
- Always power down and unplug your Mac completely before cleaning the keyboard, because moisture and electricity do not mix.
- Compressed air removes most dust and debris without requiring liquid or contact with internal parts.
- A barely damp microfiber cloth works for cleaning the visible surfaces of keys, but never pour liquid directly onto the keyboard.
- Avoid isopropyl alcohol on modern Mac keyboards, because it can damage the coating on the keycaps and seep into the mechanism.
- If liquid spills inside the keyboard, let it dry completely — at least 24 hours — before turning the Mac back on.
When compressed air alone is not enough
If dust remains stuck between keys after compressed air, you can use a soft brush. A clean toothbrush with soft bristles or a small electronics brush works. Brush gently between the keys, moving the bristles away from the keyboard so debris falls out rather than deeper in. Again, do this over a trash can.
For sticky keys caused by spilled liquid or dried residue, the damp cloth method is still your safest option. Wipe the affected key repeatedly with a barely damp cloth until the stickiness is gone. Let the keyboard sit unplugged for at least two hours afterward to may support any moisture has evaporated.
Do not use paper towels — they shed fibers that can get trapped between keys. Do not use tissues either. Microfiber cloth is worth buying because it does not leave lint behind.
What to avoid when cleaning a Mac keyboard
Never spray liquid directly onto the keyboard. Even "keyboard cleaner" sprays designed for electronics can seep into the mechanism and cause corrosion or short circuits. The only liquid that should touch your keyboard is water on a cloth that you have wrung out until it is almost dry.
Avoid isopropyl alcohol, even though it evaporates quickly. Modern Mac keyboards have a coating on the keycaps that alcohol can strip away, leaving them dull or discolored. Older keyboards are more resistant, but distilled water is safer and does the same job.
Do not pry off the keycaps to clean underneath them. Mac keyboards, especially on laptops, have a scissor mechanism or butterfly mechanism that is fragile and difficult to reassemble. If you remove a keycap and it does not snap back on easily, you risk breaking the stem or the switch underneath.
Cleaning the space bar and larger keys
The space bar, shift key, and return key are larger and sometimes accumulate more debris because of their size. Use the same compressed air and damp cloth approach, but pay extra attention to the edges where the key meets the keyboard frame.
If a large key feels sticky or unresponsive, it may have liquid trapped underneath. Tilt the keyboard so the affected key points downward, and use compressed air to blow moisture out from under the key. Let the keyboard sit unplugged for at least four hours before testing it again.
Cleaning the keyboard frame and surrounding area
While the keyboard is powered down, wipe the frame around the keys with a damp microfiber cloth. This removes dust that has settled on the plastic or aluminum surround. Pay attention to the edges where dust collects.
If your Mac has a trackpad below the keyboard, clean it the same way — damp cloth, barely wet, wiped gently. Trackpads are less sensitive to moisture than keyboards, but the same rule applies: no dripping water and no direct spraying.
What to do if liquid spills on your keyboard
Power off your Mac when ready and unplug it. Do not try to use it or test whether it still works. Tilt the keyboard so the liquid drains away from the machine, and use a dry cloth to blot up any visible moisture on the surface.
Let the keyboard sit completely unplugged for at least 24 hours, longer if the spill was large. Place it in a warm, dry location — not in direct sunlight, which can damage the plastic. After 24 hours, power on and test each key. If any key does not respond or feels sticky, wait another 24 hours before trying again.
If keys remain unresponsive after 48 hours of drying, the liquid may have damaged the electrical contacts underneath. At that point, you may need to have the keyboard serviced or replaced by Apple or an authorized repair shop.
Keeping your keyboard clean between deep cleans
Compressed air once a month prevents most buildup. Keep food and drinks away from your keyboard — this is the single most effective prevention. If you eat at your desk, use a separate keyboard or keep snacks and drinks at arm's length.
A keyboard cover can protect against dust and spills when the Mac is not in use, though it traps heat if left on during operation. Use it only when the keyboard is idle.
Frequently Asked Questions
Can I use a vacuum cleaner on my Mac keyboard?
No. Vacuums generate static electricity that can damage the electronics inside the keyboard. They also create suction that can pull small components loose. Compressed air is safer because it blows debris out rather than pulling it.
Is it safe to clean a MacBook keyboard while it is closed?
No. You need the keyboard open and visible to clean it properly and to see where moisture is going. Close the MacBook only after the keyboard is completely dry and powered back on.
What if one key is stuck and will not pop back up?
Try compressed air first — aim it under the stuck key from different angles to dislodge whatever is holding it down. If that does not work, let the keyboard dry for 24 hours in case moisture is the cause. Do not force the key down and up repeatedly, as this can damage the mechanism. If it remains stuck after drying, contact Apple Support.
How often should I clean my Mac keyboard?
A quick compressed air cleaning once a month keeps dust from building up. A deeper clean with a damp cloth every three to six months is reasonable if you eat near your keyboard or live in a dusty environment. If you keep food and drinks away, monthly compressed air may be all you need.
Can I use screen cleaner on my keyboard?
No. Screen cleaners are formulated for glass and can damage the plastic keycaps or seep into the mechanism. Stick to distilled water on a barely damp cloth.