text: Acid-base extraction works on the fundamental principle that salts are ionic compounds with a high solubility in water, while neutral molecules typically lack solubility in water.
  Consider a mixture of acidic and basic compounds dissolved in an organic solvent. Adding aqueous acid will cause the acidic component to stay uncharged, while the basic component will be protonated to form a salt. The uncharged acid component will remain dissolved in the organic solvent, while the highly charged basic salt will migrate to the aqueous solvent. Since the acidic and basic components are now in two different layers, they can easily be separated. 
  Alternatively, adding aqueous base will cause the acidic component to be deprotonated and form a salt, while the basic component will remain uncharged. In this case, the uncharged base will stay in the organic layer, while the highly charged acidic salt will migrate to the aqueous layer.
  If the organic acid component is relatively weak and has a pK value of ~5 (such as a carboxylic acid), adding additional acid can further improve separation by lowering the pH of the solution. This minimizes the self ionization of the organic acid component and limits its tendency to enter the aqueous layer. This principle is also applicable to an organic base when it is a relatively weak base.
  Although acid-base extractions are most commonly used to separate acids from bases, they can be used to separate two acids or two bases from each other. However, the acids and bases must differ greatly in strength, e.g. one strong acid and one very weak acid. Therefore, the two acids must have a pK (or pK) difference that is as large as possible. For example, the following can be separated:
  * Very weak acids like phenols (pK around 10) from stronger acids like carboxylic acids (pK around 4–5).
  * Very weak bases (pK around 13–14) from stronger bases (pK around 3–4). This is frequently used in purifying soil to determine trace metal concentration.
  When separating two acids or two bases, the pH is usually adjusted to a value roughly between the pK (or pK) constants. Separation occurs at this intermediate pH because one component is fully ionized, while the other is fully in its neutral form. Often, the solutions used to extract the acids or bases can also be used to control the pH. When separating two acids, the mixture is first washed with a weak base (e.g. sodium bicarbonate) to extract the strong acid, then washed with a strong base (e.g. sodium hydroxide) to extract the weak acid. For separating basic components, weak acid (e.g. dilute acetic acid) is first used to extract the stronger base, then more concentrated acid (e.g. hydrochloric acid or nitric acid) is used to create strongly acidic pH values and separate the weaker base.