Barium hydroxide is used in titrations. If sodium hydroxide solution is used, some sodium carbonate may be in there. It is less basic than sodium hydroxide, so the titration can be messed up. When barium hydroxide reacts with carbon dioxide to make barium carbonate, it forms a white solid that can be removed.