Both acids and bases dissociate into ions (\boldsymbol{\textbf{H}^+} in acids and \boldsymbol{\textbf{OH}^-} in bases), which allows them to conduct electricity.