A buffer works by accepting hydrogen ions from the solution when they are in excess and donating hydrogen ions to the solution when they have been depleted.

Carbonic acid (H2CO3) acts as a buffer by dissociating to yield a bicarbonate ion (HCO3-) and a hydrogen ion (H+). 2