We study discrete electric and magnetic fluxes in gauge theories from algebraic and topological viewpoints. We explain that they can not be simultaneously specified in a sector of quantum Hilbert space. This is the uncertainty of fluxes discovered previously in Abelian gauge theories. We further interpret the discrete fluxes as charges of higher-form symmetries, which leads to an enhanced understanding of the latter in terms of cohomology groups of spacetime with coefficients in a group. More generally, higher-form symmetries exist whenever there are constant gauge transformations. Finally, we explore the relations to Noether's second theorem and higher Ward identities.