Gauss's law

The flux out of any closed surface equals the charge inside divided by epsilon nought, whatever the surface's size, so with spherical symmetry one flux calculation gives the field, inside and outside a charged sphere.

From AP Physics C: Electricity and Magnetism.