However, you can ask how many Earths would fit *by volume* within the Sun.
Here's how to calculate that:
* Sun's volume: 1.41 x 10^18 km³
* Earth's volume: 1.08 x 10^12 km³
Divide the Sun's volume by the Earth's volume:
(1.41 x 10^18 km³) / (1.08 x 10^12 km³) = 1.3 x 10^6
Therefore, about 1.3 million Earths could fit inside the Sun by volume.