We develop the dual picture for quantum electrodynamics in 3+1 dimensions. It is shown that the photon is massless in the Coulomb phase due to spontaneous breaking of the magnetic symmetry group. The generators of this group are the magnetic fluxes through any infinite surface s. The order parameter for this symmetry breaking is the operator V(C), which creates an infinitely long magnetic vortex. We show that although the order parameter is a stringlike rather than a local operator, the Goldstone theorem is applicable if V(C)0. If the system is properly regularized in the infrared, we find V(C)0 in the Coulomb phase and V(C)=0 in the Higgs phase. The Higgs-Coulomb phase transition is therefore understood as a condensation of magnetic vortices. The electric charge in terms of V(C) is topological and is equal to the winding number of the mapping from a circle at spatial infinity into the manifold of possible vacuum expectation values of a magnetic vortex in a given direction. Since the vortex operator takes values in S1 and 1(S1)=Z, the electric charge is quantized topologically.