Most AAA, AA, C and D nonrechargeable batteries are alkaline, which means the electrolyte enclosed inside the casing is potassium hydroxide -- a type of lye. If the battery explodes -- which is rare, but possible -- you could get this chemical on your skin or clothes or in your eyes. The remedy is to flush with plenty of water. After removing most of the chemical with water, neutralize what remains with vinegar or lemon juice. Don't use these chemicals before flushing with water, though, because the acid/base reaction would produce enough heat to give you a serious burn.
Why Alkaline Batteries Explode
When an alkaline battery heats up or is exposed to a strong electrical current, the energy releases hydrogen gas inside the battery sheathing. As the vapor pressure inside the battery reaches a critical point, the sheathing ruptures. In most cases, the battery will simply leak, but if the vapor pressure is high enough, it can explode.
Alkaline batteries from reliable manufacturers are vented to allow built up heat and energy to dissipate. Because of this, they seldom explode, but they might when used in a high-heat environment that doesn't allow the energy to dissipate. They can also explode when subjected to a high or persistent electrical current. This might happen to a battery installed in a smoke detector, which is hardwired to an electrical circuit. An explosion is also a possibility when you insert a nonrechargeable battery into a charger or when you install one the wrong way in a device that takes two or more other batteries.
Consequences of an Explosion
In very rare cases, a battery explosion can cause injury. If you happen to be too close to a battery when it explodes, you could get shards in your eye. If so, you need immediate medical attention. Moreover, a battery explosion in a high-heat environment could produce enough energy to start a fire.
Apart from these worst-case scenarios, the most serious consequence of a battery explosion is the release of potassium hydroxide. In a strong explosion, you could be sprayed with this chemical, and some of it is almost certain to leak onto the battery terminals or onto other exposed circuit components. Lye is corrosive, so it's important to remove it quickly to avoid burns or equipment damage.
Soap makers regularly use lye, and they recommend cleaning it with water. Vinegar is acidic and can be used to neutralize lye, but you should never apply it to your skin until you've first washed off most of the lye with water. The reaction between vinegar and lye is strongly exothermic, and it produces enough heat to cause burns. After you've washed most of the lye off your skin or clothes, however, you can and should neutralize the small amount that remains by rubbing with a rag or swab soaked in vinegar. If you don't have any vinegar, use pure lemon juice, which is also acidic.
When a battery leaks or explodes, it deposits potassium hydroxide on the battery terminals and sometimes on the circuitry inside the device being powered. The corrosive chemical quickly degrades these metal parts, so it's important to clean it off. Use a cotton swab soaked with vinegar or lemon juice to do this -- the heat of the acid base reaction should have little to no effect on metal. Some of the chemical may have hardened; if so, scrape it off with a flat-head screwdriver or a needle first. If you're worried about damaging a sensitive part, wipe off as much as you can with water before neutralizing the rest with acid.