The twin paradox is the best known thought experiment associated with Einstein's theory of relativity. An astronaut who makes a journey into space in a high-speed rocket will return home to find he has aged less than a twin who stayed on Earth. This result appears puzzling, since the situation seems symmetrical, as the homebody twin can be considered to have done the travelling with respect to the traveller. Hence it is called a "paradox". In fact, there is no contradiction and the apparent paradox has a simple resolution in Special Relativity with infinite flat space. In General Relativity (dealing with gravitational fields and curved space-time), or in a compact space such as the hypersphere or a multiply connected finite space, the paradox is more complicated, but its resolution provides new insights about the structure of spacetime and the limitations of the equivalence between inertial reference frames.