We characterise the quantum group gauge symmetries underlying q-deformations of two-dimensional Yang–Mills theory by studying their relationships with the matrix models that appear in Chern–Simons theory and six-dimensional N=2 gauge theories, together with their refinements and supersymmetric extensions. We develop uniqueness results for quantum deformations and refinements of gauge theories in two dimensions, and describe several potential analytic and geometric realisations of them. We reconstruct standard q-deformed Yang–Mills amplitudes via gluing rules in the representation category of the quantum group associated to the gauge group, whose numerical invariants are the usual characters in the Grothendieck group of the category. We apply this formalism to compute refinements of q-deformed amplitudes in terms of generalised characters, and relate them to refined Chern–Simons matrix models and generalised unitary matrix integrals in the quantum β-ensemble which compute refined topological string amplitudes. We also describe applications of our results to gauge theories in five and seven dimensions, and to the dual superconformal field theories in four dimensions which descend from the N=(2,0) six-dimensional superconformal theory.