The Wittig reaction converts aldehydes or ketones to alkenes using phosphorus ylide, or the Wittig reagent. Phosphorus ylide is a neutral molecule with a negatively charged carbon and a positively charged phosphorus atom, stabilized by resonance. It is synthesized from unhindered alkyl halides in two steps. First, triphenylphosphine attacks the alkyl halide via an SN2 process, forming a phosphonium salt. The salt reacts with a strong base that deprotonates the weakly acidic α hydrogen, generating the carbanionic ylide nucleophile. Wittig reactions are regioselective, as the new C⁠=⁠C bond is formed explicitly at the carbonyl position. The reactions are also stereoselective depending on the ylide. Phosphorus ylides with electron-withdrawing groups—stabilized by additional resonance structure—predominantly generate E alkenes. Reagents with simple alkyl groups primarily form Z alkenes. Steric crowding around the carbonyl group affects the yield of the products formed: Sterically hindered ketones give poor yields compared to unhindered aldehydes.