In chemistry, a zwitterion (// TSVIT-ə-rye-ən; from German Zwitter [ˈtsvɪtɐ] 'hermaphrodite'), also called an inner salt or dipolar ion, is a molecule that contains an equal number of positively- and negatively-charged functional groups. With amino acids, for example, in solution a chemical equilibrium will be established between the "parent" molecule and the zwitterion.
Betaines are zwitterions that cannot isomerize to an all-neutral form, such as when the positive charge is located on a quaternary ammonium group. Similarly, a molecule containing a phosphonium group and a carboxylate group cannot isomerize.
The equilibrium is established in two stages. In the first stage, a proton is transferred from the carboxyl group to a water molecule:
Overall, the reaction is an isomerization reaction
The ratio of the concentrations of the two species in solution is independent of pH as it is equal to the value of the equilibrium constant K for the isomerization reaction:
where [X] signifies the concentration of the chemical species X at equilibrium. It is generally assumed that K > 1, that is, that the zwitterion is the predominant amino acid isomer in aqueous solution. It has been suggested, on the basis of theoretical analysis, that the zwitterion is stabilized in aqueous solution by hydrogen bonding with solvent water molecules. Analysis of neutron diffraction data for glycine showed that it was in the zwitterionic form in the solid state and confirmed the presence of hydrogen bonds. Theoretical calculations have been used to show that zwitterions may also be present in the gas phase for some cases different from the simple carboxylic acid-to-amine transfer.
The pKa values for deprotonation of the common amino acids span the approximate range 2.15±0.2. This is also consistent with the zwitterion being the predominant isomer that is present in an aqueous solution. For comparison, the simple carboxylic acid propionic acid (CH3CH2CO2H) has a pKa value of 4.88.
In Psilocybin the proton on the dimethyl amino group is labile and may jump to the phosphate group to form a compound which is not a zwitterion.
Insight to the equilibrium in solution may be gained from the results of theoretical calculations. For example, pyridoxal phosphate, a form of vitamin B6, in aqueous solution is predicted to have an equilibrium favoring a tautomeric form in which a proton is transferred from the phenolic -OH group to the nitrogen atom.
Because tautomers are different compounds, they sometimes have different enough structures that they can be detected independently in their mixture. This allows experimental analysis of the equilibrium.
The compound trimethylglycine, which was isolated from sugar beet, was named as "betaine". Later, other compounds were discovered that contain the same structural motif, a quaternary nitrogen atom with a carboxylate group attached to it via a –CH2– link. At the present time, all compounds whose structure includes this motif are known as betaines. Betaines do not isomerize because the chemical groups attached to the nitrogen atom are not labile. These compounds may be classed as permanent zwitterions, as isomerisation to a molecule with no electrical charges does not occur, or is very slow.
Other examples of permanent zwitterions include phosphatidylcholines, which also contain a quaternary nitrogen atom, but with a negatively-charged phosphate group in place of a carboxylate group; sulfobetaines, which contain a quaternary nitrogen atom and a negatively charged sulfonate group; and pulmonary surfactants such as dipalmitoylphosphatidylcholine. Lauramidopropyl betaine is the major component of cocamidopropyl betaine.
Strongly polarized conjugated compounds (conjugated zwitterions) are typically very reactive, share diradical character, activate strong bonds and small molecules, and serve as transient intermediates in catalysis.  Donor-acceptor entities are of vast use in photochemistry (photoinduced electron transfer), organic electronics, switching and sensing.