We numerically study the focusing effect induced by a single p–n junction in three-dimensional topological insulators (3D TIs). It is found that, for either surface states or bulk states of 3D TIs, the corresponding electrons injected from the n/p region can be perfectly focused at the symmetric position in the p/n region. These results suggest that the focusing effect is a general phenomenon in materials which can be described by massless or massive Dirac equations. We also find that the focusing effect is robust against moderate random disorders. In the presence of external magnetic fields, the focusing effect remains good, but the position of the focus point oscillates periodically due to the finite size effect.