Dark matter or modifications of the Newtonian inverse‐square law in the Solar system are studied with accurate planetary astrometric data. From extraperihelion precession and possible changes in the third Kepler's law, we get an upper limit on the local dark matter density, ρDM≲ 3 × 10−16 kg m−3 at the 2σ confidence level. Variations in the 1/r2 behaviour are considered in the form of either a possible Yukawa‐like interaction or a modification of gravity of Milgrom's modified Newtonian dynamics (MOND) type. Up to scales of 1011 m, scale‐dependent deviations in the gravitational acceleration are really small. We examined the MOND interpolating function μ in the regime of strong gravity. Gradually varying μ suggested by fits of rotation curves are excluded, whereas the standard form μ(x) =x/(1 +x2)1/2 is still compatible with data. In combination with constraints from galactic rotation curves and theoretical considerations on the external field effect, the absence of any significant deviation from inverse square attraction in the Solar system makes the range of acceptable interpolating functions significantly narrow. Future radio ranging observations of outer planets with an accuracy of few tenths of a metre could either give positive evidence of dark matter or disprove modifications of gravity.