Calculating the pH of bases requires an extra step, as they dissociate with water to make hydroxide ions, OH-, instead of hydronium ions, H3O+.
WATER DISSOCIATION CONSTANT, KW
The extra step requires us to have an understanding of the dissociation of water:
H2O + H2O ⇌ H3O+ + OH-
In pure water, the pH = 7.0, so the concentration of hydronium ions is 10-7 mol L-1. As the number of moles of hydronium ions is the same as the number of moles of hydroxide ions, the concentration of hydroxide ions is also 10-7 mol L-1.
Therefore, the equilibrium constant for this (called KW) is 10-7 × 10-7 = 10-14. This will become very important shortly.
KW = [H3O+][OH-] = 10-14
Acids increase the concentration of hydronium ions, so shift this equilibrium to the left, reducing the concentration of hydroxide ions, to return the equilibrium constant to 10-14.
Likewise, bases increase the concentration of hydroxide ions, so shift this equilibrium to the left, reducing the concentration of hydronium ions, to return the equilibrium constant to 10-14.