Formula: why the answer is about 1.3 million
Use R for the Sun's radius and r for Earth's radius. A sphere's volume is V = 4/3 x pi x radius^3, so the shared 4/3 x pi part cancels out when we compare two spheres.
Count = (R / r)3
For the default Sun/Earth comparison: R = 695,700 km and r = 6,371.0 km. The radius ratio is 695,700 / 6,371.0 = 109.1979. Cube that ratio: 109.19793 = 1,302,096.6. Rounded for a plain answer, about 1.3 million Earths fit inside the Sun by volume.
The packed-sphere estimate is separate: 1,302,096.6 x 0.74048 = 964,176.5. That lower number answers a different question: how many Earth-sized solid spheres might fit if gaps between spheres count against the total.
