We describe a simple technique for generating a cold-atom lattice pierced by a uniform magnetic field. Our method is to extend a one-dimensional optical lattice into the "dimension" provided by the internal atomic degrees of freedom, yielding a synthetic two-dimensional lattice. Suitable laser coupling between these internal states leads to a uniform magnetic flux within the two-dimensional lattice. We show that this setup reproduces the main features of magnetic lattice systems, such as the fractal Hofstadter-butterfly spectrum and the chiral edge states of the associated Chern insulating phases.