Using the theory of cohomological invariants for algebraic stacks, we compute the Brauer group of the moduli stack of hyperelliptic curves ${\mathcal {H}}_g$ over any field of characteristic $0$. In positive characteristic, we compute the part of the Brauer group whose order is prime to the characteristic of the base field.