How to Clean a Mechanical Keyboard Safely
How to Clean a Mechanical Keyboard Safely
Cleaning a mechanical keyboard is genuinely worth doing, and not only for appearance. Contamination on a switch's contact leaf is one of the most common causes of a key that registers twice from one press, and a crumb under a keycap is the most common cause of a key that needs an extra-hard press. Both are fixed by cleaning, and neither needs new parts.
It is also easy to get wrong in ways that cost you a keyboard. This guide covers three levels of cleaning depending on what you need, then the specific things to avoid — including two pieces of widely repeated advice that will damage your board.
Test before and after with the mechanical keyboard test, which shows a per-key press count. That gives you an objective before-and-after rather than a vague sense that it feels better.
What you need
Nothing on this list is expensive, and most of it you already have.
Essential
- Keycap puller — the wire kind, not the plastic ring kind. Wire pullers grip under the cap and lift straight; plastic ring pullers scratch the sides of keycaps.
- Compressed air — a can, or an electric duster if you clean often.
- Isopropyl alcohol, 90% or higher. The concentration matters: lower grades contain more water, which takes longer to evaporate. 70% rubbing alcohol will work in a pinch but dries much more slowly.
- Microfibre cloth and cotton swabs.
Useful for a deeper clean
- Soft brush — a clean paintbrush or an old toothbrush.
- Switch puller, if your board is hot-swap.
- Bowl of warm water and a little washing-up liquid, for the keycaps.
- A phone camera, to photograph the layout before you pull anything.
Do not use: household cleaning sprays, glass cleaner, acetone, bleach, or anything containing solvents beyond isopropyl alcohol. They attack keycap plastics and legends.
Level 1: The five-minute clean (do this monthly)
No disassembly. This handles most day-to-day accumulation.
- Unplug the keyboard. Every time, whatever level of cleaning you are doing. On a wireless board, switch it off as well.
- Turn it upside down and shake it gently. You will be surprised. Do this over a bin.
- Compressed air between the keys. Hold the can upright — tilting it sprays liquid propellant onto your PCB, which is cold enough to cause condensation. Use short bursts at an angle across the keys rather than straight down, so debris is pushed out rather than deeper in.
- Wipe the keycap tops with a microfibre cloth barely damp with isopropyl alcohol. Barely damp: no drips.
- Cotton swab around the edges of any key that has been feeling sticky.
That is it. If a key was feeling mushy or needed a hard press, test it now — a meaningful share of single-key faults resolve at this level.
Level 2: Keycaps off (every few months)
This is where the real dirt is, and it is still low risk.
Photograph the layout first
Before pulling a single cap, take a clear photo of the whole keyboard. Modern layouts vary in ways that are not obvious once the caps are in a bowl — the bottom row especially, where key widths differ between boards. Ten seconds now saves a puzzled twenty minutes later.
Pull the keycaps
Hook the wire puller under two opposite corners of the cap and pull straight up. Do not rock it side to side; that stresses the switch stem, and a snapped stem means replacing the switch.
The large keys need care. Space, Enter, Backspace and both Shifts sit on stabilisers — a wire and two extra stems that keep the long cap level. Pull these straight up and slowly. The wire can stay attached to the cap and unclip from the PCB housing, which is fixable but fiddly. If a stabilised cap resists, stop and check both ends are lifting together.
Clean the exposed board
With the caps off, the plate is accessible:
- Compressed air first, to move the loose material.
- Soft brush to lift what is stuck between the switch housings.
- Cotton swab with isopropyl alcohol around each switch housing — this is where skin oil and dust combine into the grey film that causes sticky keys.
- Do not flood the plate with alcohol. Damp swabs, not a pour.
Wash the keycaps
Warm water with a little washing-up liquid, in a bowl. Let them soak for 10 to 20 minutes, agitate, then rinse thoroughly.
Then the step people skip and regret: let them dry completely. Several hours, spread out on a towel, legend side down. Water trapped inside a cap will drip into the switch when you reinstall it. If you are impatient, a fan speeds this up considerably; heat does not, and heat can warp ABS caps.
Never put keycaps in a dishwasher. The temperature warps them and the detergent strips printed legends. This advice circulates widely and it is wrong.
Reinstall
Line each cap over its stem and press straight down until it clicks. Check the photo. Then run the mechanical keyboard test and press every key — a cap that is not fully seated feels fine and fails to actuate on off-centre presses, and this is the fastest way to catch it.
Level 3: Switch-level cleaning (only when a key misbehaves)
Do not do this as routine maintenance. Do it when a specific key is chattering — registering twice from one deliberate press — or feels scratchy in a way its neighbours do not.
Confirm the fault first
Open the double typing test and tap the suspect key twenty times. If you see two events with a gap under about 30 milliseconds, that is chatter: no human hand produces that interval. Now you know cleaning has a target.
The alcohol flush
The fix that works for a chattering switch, without removing it:
- Pull the keycap.
- Put a drop or two of 90%+ isopropyl alcohol into the switch housing, at the stem.
- Actuate the stem 30 to 40 times. This is the part that does the work — the alcohol carries contamination off the contact leaf, and the movement is what dislodges it.
- Let it dry for 10 minutes before plugging in.
- Retest with the double typing test.
This resolves a meaningful share of chattering switches, particularly ones only a year or two old. Manufacturers rate MX-style switches at 50 to 100 million presses, so a switch chattering at two years has nowhere near worn out — contamination is far more likely than wear, which is exactly why flushing works.
If flushing fails twice, replace the switch
On a hot-swap board this is a five-minute job: switch puller, lift straight up, new switch in. Check the new switch's legs from the side before inserting — bent pins are the cause of nearly every "my new switch does nothing" report, and they bend on insertion far more easily than people expect.
On a soldered board, replacement means desoldering. If you do not have the equipment, raising the debounce window in QMK or your vendor software will suppress the doubling. Be clear with yourself that this is masking rather than repair: the switch keeps degrading and the value will need to keep rising.
After a spill
Speed matters more than technique here.
- Cut the power immediately. Unplug it; on a wireless board, switch it off and remove the battery if it is removable. Do not "shut it down properly" — every second powered with liquid inside risks a short.
- Turn it upside down so liquid drains away from the PCB rather than through it.
- Pull the keycaps and blot what you can reach with a cloth.
- For anything other than plain water, flush with isopropyl alcohol. Sugary drinks are dramatically worse than water because the residue keeps conducting after it dries, and alcohol dissolves the sugar that water alone leaves behind.
- Let it dry for 24 to 48 hours before power. Longer if the spill was substantial.
Two things not to do, both widely recommended and both wrong:
- Do not use a hairdryer or any heat source. Heat warps keycaps and can damage the PCB, and it drives liquid into places it had not reached.
- Do not put it in rice. There is no evidence that rice draws moisture out of electronics, and it introduces starch and dust into a device you have just opened.
If a spill was heavy and the board does not recover after drying, a mechanical keyboard is more repairable than most electronics — individual switches can be replaced, and on many boards the PCB is a separate part. It is worth a look before writing it off.
Maintenance that is not cleaning
A few things get bundled into "cleaning" advice that are really something else.
Stabiliser rattle. The noise on Space, Enter and Shift is the metal wire moving in its housing, not dirt and not a fault. A small amount of thick grease on the wire ends and a strip of tape on the PCB under the stabiliser quiets it substantially. Cleaning will not change it.
Lubricating switches. This improves smoothness and sound on linear and tactile switches and is the most popular modification in the hobby. It is a tuning exercise, not maintenance, and it requires desoldering or a hot-swap board plus switch disassembly. One firm caution: never lubricate the click mechanism of a clicky switch. The click is produced mechanically, lubricant deadens it, and the change cannot be undone.
Shiny keycaps. ABS plastic develops a shine with use and pad-printed legends rub away — neither is dirt, and neither will clean off. PBT caps resist both, and doubleshot or dye-sublimated legends are moulded or dyed in rather than printed on top. If your legends are wearing, replacement caps are the answer.
Frequently asked questions
How often should I clean a mechanical keyboard?
A five-minute surface clean monthly, keycaps off every three to six months depending on how much you eat at your desk. Switch-level cleaning is not routine maintenance — do it only when a specific key starts misbehaving. Cleaning more often than this does no harm but achieves little.
Can I use water to clean keycaps?
Yes, and it is the right choice for the caps themselves. Warm water with a little washing-up liquid, soak for 10 to 20 minutes, rinse, then let them dry completely for several hours before reinstalling. The essential part is the drying — water trapped inside a cap drips straight into the switch when you put it back. Never use a dishwasher: the heat warps caps and the detergent strips legends.
Will isopropyl alcohol damage my keyboard?
Not at 90% or higher, used sparingly. It evaporates quickly and leaves no residue, which is exactly why it is the standard choice for electronics. What causes damage is quantity — flooding a powered board. Use damp swabs and cloths rather than pours, keep the board unplugged, and give it a few minutes before reconnecting.
Can cleaning fix a key that types twice?
Often, yes. Double typing is usually switch chatter, caused by contamination on the contact leaf making it bounce longer than the firmware's debounce window allows. A drop of isopropyl alcohol into the housing while actuating the stem 30 to 40 times clears that contamination and fixes a real share of cases, especially on switches only a year or two old. If two attempts fail, replace the switch.
Should I remove the switches to clean them?
Not for cleaning. The alcohol flush works with the switch in place, and pulling switches adds risk — bent pins on reinsertion are common — for no cleaning benefit. Remove a switch when you are replacing it, or when you are lubricating and need to open it. Not to clean it.
What should I do immediately after spilling a drink on my keyboard?
Unplug it that second, turn it upside down to drain, and pull the keycaps to blot what you can reach. For anything sugary, flush with isopropyl alcohol — sugar residue keeps conducting after it dries and water alone leaves it behind. Then leave it 24 to 48 hours before applying power. Do not use heat, and do not put it in rice.
Does cleaning make a keyboard sound better?
Marginally. Debris under keycaps can add a gritty edge, so removing it helps a little. But the sound of a keyboard is mostly determined by its case, plate, switches and keycap material — cleaning does not change any of those. If you are chasing a particular sound, the keyboard sound test lets you hear the common switch profiles before you buy anything.
Related tools and reading
- Mechanical keyboard test — per-key press counts, before and after cleaning
- Double typing test — confirm chatter, and confirm it is gone
- Keyboard sound test — switch sound profiles
- Why is my keyboard typing double letters? — the full diagnosis