Schwarzschild Radius Formula
Setting the Newtonian escape velocity equal to the speed of light ($v_e = c$): \[ \frac{1}{2}mv^2 = \frac{GMm}{r} \implies v = \sqrt{\frac{2GM}{r}} \] Setting $v = c$: \[ r_s = \frac{2GM}{c^2} \]
Earth's Schwarzschild Radius
For Earth ($M \approx 5.97 \times 10^{24}$ kg), $r_s \approx 8.87$ mm. Earth would need to be compressed to the size of a marble to become a black hole.
Sun's Schwarzschild Radius
For the Sun ($M \approx 1.99 \times 10^{30}$ kg), $r_s \approx 2.95$ km. The Sun would need to be compressed to a sphere less than 6 km in diameter.