The Martian ionosphere's local total electron content (TEC) and the neutral atmosphere scale height can be derived from radar echoes reflected from the surface of the planet. We report the global distribution of the TEC by analyzing more than 750,000 echoes of the Mars Advanced Radar for Subsurface and Ionospheric Sounding (MARSIS). This is the first direct measurement of the TEC of the Martian ionosphere. The technique used in this paper is a novel "transmission-mode" sounding of the ionosphere of Mars in contrast to the Active Ionospheric Sounding experiment (AIS) on MARSIS, which generally operates in the reflection mode. This technique yields a global map of the TEC for the Martian ionosphere. The radar transmits a wideband chirp signal that travels through the ionosphere before and after being reflected from the surface. The received waves are attenuated, delayed and dispersed, depending on the electron density in the column directly below the spacecraft. In the process of correcting the radar signal, we are able to estimate the TEC and its global distribution with an unprecedented resolution of about 0.1 deg in latitude (∼5 km footprint). The mapping of the relative geographical variations in the estimated nightside TEC data reveals an intricate web of high electron density regions that correspond to regions where crustal magnetic field lines are connected to the solar wind. Our data demonstrates that these regions are generally but not exclusively associated with areas that have magnetic field lines perpendicular to the surface of Mars. As a result, the global TEC map provides a high-resolution view of where the Martian crustal magnetic field is connected to the solar wind. We also provide an estimate of the neutral atmospheric scale height near the ionospheric peak and observe temporal fluctuations in peak electron density related to solar activity.