Topological phases enable protected transport along the edges of materials, offering immunity against scattering from disorder and imperfections. These phases have been demonstrated for electronic systems, electromagnetic waves1-5, cold atoms6,7, acoustics8 and even mechanics9, and their potential applications include spintronics, quantum computing and highly efficient lasers10-12. Typically, the model describing topological insulators is a spatial lattice in two or three dimensions. However, topological edge states have also been observed in a lattice with one spatial dimension and one synthetic dimension (corresponding to the spin modes of an ultracold atom13-15), and atomic modes have been used as synthetic dimensions to demonstrate lattice models and physical phenomena that are not accessible to experiments in spatial lattices13,16,17. In photonics, topological lattices with synthetic dimensions have been proposed for the study of physical phenomena in high dimensions and interacting photons18-22, but so far photonic topological insulators in synthetic dimensions have not been observed. Here we demonstrate experimentally a photonic topological insulator in synthetic dimensions. We fabricate a photonic lattice in which photons are subjected to an effective magnetic field in a space with one spatial dimension and one synthetic modal dimension. Our scheme supports topological edge states in this spatial-modal lattice, resulting in a robust topological state that extends over the bulk of a two-dimensional real-space lattice. Our system can be used to increase the dimensionality of a photonic lattice and induce long-range coupling by design, leading to lattice models that can be used to study unexplored physical phenomena.