Birkhoff's theorem is discussed in the frame of f(R) gravity by using its scalar–tensor representation. Modified gravity has become very popular in recent times as it is able to reproduce the unification of inflation and late-time acceleration with no need of a dark energy component or an inflation field. Here, another aspect of modified f(R) gravity is studied, specifically the range of validity of Birkhoff's theorem, compared with another alternative to general relativity, the well-known Brans–Dicke theory. As a novelty, here both theories are studied using a conformal transformation and writing the actions in the Einstein frame, where spherically symmetric solutions are studied using perturbation techniques. The differences between both theories are analyzed as well as the validity of the theorem within the Jordan and Einstein frames, where interesting results are obtained.