Putting the spacecraft id (-143205) into the JPL HORIZONS ephemeris system produces:
TRAJECTORY: This trajectory is based on JPL solution #10, a fit to 364 ground-based optical astrometric measurements spanning 2018 Feb 8.2 to March 19.1
Trajectory name Start (TDB) Stop (TDB)
-------------------------------- ----------------- -----------------
tesla_s10 2018-Feb-07 03:00 2090-Jan-01 00:00
Encounter predictions for s10 (w/radial 1/r^2 non-gravitational acceleration)
Date (TDB) Body CA Dist MinDist MaxDist Vrel TCA3Sg Nsigs P_i/p
----------------- ----- ------- ------- ------- ------ ------ ------ ------
2018 Feb 08.09690 Moon .000936 .000936 .000936 3.961 0.41 47509. 0.000
2020 Oct 07.26768 Mars .049530 .048923 .050242 8.150 27.40 6.63E5 0.000
2035 Apr 22.35934 Mars .015504 .004378 .027978 8.219 170.47 31247. 0.000
2047 Jan 11.89023 Earth .031919 .031716 .032123 4.493 249.70 78398. 0.000
2050 Mar 19.52949 Earth .119113 .113778 .124369 7.397 538.54 2.61E5 0.000
2052 Sep 05.15606 Mars .176363 .172469 .180319 5.738 2185.5 8.68E5 0.000
2067 Apr 15.90202 Mars .043270 .025712 .061471 7.192 1115.0 42565. 0.000
2084 Sep 17.92284 Mars .116962 .093449 .141170 9.753 787.45 6.55E5 0.000
2085 Jan 01.96490 Earth .083063 .049368 .112186 6.224 5208.9 1.00E5 0.000
2088 Mar 09.95754 Earth .049146 .033491 .063322 5.106 4505.2 1.17E5 0.000
Date = Nominal encounter time (Barycentric Dynamical Time)
CA_Dist = Highest probability close approach distance to body, au
MinDist = 3-sigma minimum encounter distance, au
MaxDist = 3-sigma maximum encounter distance, au
Vrel = Relative velocity at nominal encounter time, km/s
TCA3Sg = 3-sigma uncertainty in close encounter time, minutes
Nsigs = Number of sigmas to encounter body at nominal encounter time
P_i/p = Linearized probability of impact
So from this we can see that the closest approach to Mars is the 2035 April 22 encounter at 0.015504 AU (2319365.39 kilometers) but as you can see by the big difference between the MinDist
and MaxDist
there is substantial uncertainty in exactly how close to the planet it will go. This is because the measurements of the position don't cover a very large fraction of the orbit and there are a lot of other non-gravitional effects which could affect the orbit over time.