The largest tsunamis are generated by seafloor uplift resulting from rupture of offshore subduction-zone megathrusts. The rupture of the shallowest part of a megathrust often produces unexpected outsize tsunami relative to their seismic magnitude. These are so called ‘tsunami earthquakes’, which are difficult to identify rapidly using the current tsunami warning systems, even though, they produce some of the deadliest tsunami. We here introduce a new method to evaluate the tsunami risk by measuring ionospheric total electron content (TEC). We examine two Mw 7.8 earthquakes (one is a tsunami earthquake and the other is not) generated in 2010 by the Sunda megathrust, offshore Sumatra, to demonstrate for the first time that observations of ionospheric sounding from Global Navigation Satellite System (GNSS) can be used to evaluate the tsunamigenic potential of earthquakes as early as 8 min after the mainshock.