The conditions under which a dynamo can operate in the core of a small planetary body or asteroid are examined. Compositional convection driven by inner core growth is thermodynamically much more efficient than thermal convection at driving a dynamo, but whether asteroid cores crystallize in this fashion is currently uncertain. Inner core solidification will drive dynamo activity in cores larger than ≈50–150 km in radius. Dynamo activity requires core cooling rates exceeding ∼0.001–0.1 K/My if compositional convection occurs. In the absence of an inner core, cooling rates of ∼1–100 K/My or heating by 60Fe within 10–20 Myr of solar system formation are required to drive a dynamo. If inner core growth is important (as for the IVB iron meteorite parent body) then a dynamo should develop with magnetic paleointensities that depend on the core sulphur content. If 60Fe decay is dominant, the frequency of asteroid dynamo occurrence is predicted to decay with distance from the Sun.