Gauss's Law Calculator
Enter an enclosed charge (or electric flux) and the geometry of your Gaussian surface to get the electric field strength, total flux, and surface area instantly. Choose between a spherical surface around a point charge, a cylindrical surface around a line charge, an infinite planar sheet, or a fully custom surface area. The step-by-step panel shows exactly how each number is derived from first principles.
What is Gauss's Law?
Gauss's Law is one of Maxwell's four fundamental equations of electromagnetism. It states that the total electric flux Phi through any closed surface equals the total charge Q enclosed by that surface divided by the permittivity of the medium: Phi = Q / epsilon. The key insight is that the flux depends only on the enclosed charge, not on the shape or size of the surface, and not on where the charge sits inside it. This makes Gauss's Law a powerful shortcut for calculating electric fields in highly symmetric situations such as spheres, cylinders, and infinite planes, where it reduces a difficult integral to a simple algebraic equation.
How to use this calculator
Select the geometry of your Gaussian surface: spherical (point charge or uniformly charged sphere), cylindrical (infinite line charge), infinite planar sheet (pillbox surface), or a fully general closed surface where you supply the area directly. Then choose what you want to solve for: electric flux given the charge, enclosed charge given a measured flux, or the electric field magnitude at the surface. Fill in the charge or flux value in your preferred unit (nC, uC, mC, or C), enter the relevant dimension (radius, cylinder length, or surface area), and the results update instantly. Toggle 'Custom permittivity' if you need to account for a dielectric material such as glass (about 5-10) or water (about 80) instead of vacuum.
Applying the law to different geometries
For a spherical surface of radius r around a point charge Q, the field is uniform over the surface, so Phi = E * 4*pi*r^2 = Q/epsilon. Solving for E gives E = Q / (4*pi*epsilon*r^2), the familiar inverse-square Coulomb field. For a coaxial cylindrical surface of radius r and length L around a line charge of linear density lambda, the flux through the curved wall is E * 2*pi*r*L = Q_enc/epsilon, where Q_enc = lambda*L, giving E = lambda / (2*pi*epsilon*r). For an infinite planar sheet with surface charge density sigma, a pillbox Gaussian surface of face area A shows that E * 2A = sigma*A/epsilon, so E = sigma/(2*epsilon), a uniform field independent of distance.
Gauss's Law in dielectric media
In a material medium with relative permittivity epsilon_r (also called the dielectric constant), the effective permittivity becomes epsilon = epsilon_0 * epsilon_r, and the flux equation becomes Phi = Q_free / epsilon. The electric field inside a dielectric is therefore reduced by a factor of epsilon_r compared with vacuum. Common values are 1 for vacuum or dry air, 2-4 for common plastics, 5-10 for glass, and about 80 for water at room temperature. Toggle the 'Custom permittivity' switch in the calculator to account for any of these materials.
Common charge configurations and Gauss's Law results
| Configuration | Gaussian surface | Electric field E | Notes |
|---|---|---|---|
| Point charge Q | Sphere of radius r | E = Q / (4*pi*eps0*r^2) | Inverse-square law; same as outside a uniform sphere |
| Infinite line charge (lambda C/m) | Coaxial cylinder, radius r, length L | E = lambda / (2*pi*eps0*r) | Falls as 1/r, not 1/r^2 |
| Infinite planar sheet (sigma C/m^2) | Pillbox spanning the sheet | E = sigma / (2*eps0) | Uniform; independent of distance |
| Uniformly charged sphere (outside) | Concentric sphere of radius r > R | E = Q / (4*pi*eps0*r^2) | Identical to point charge |
| Uniformly charged sphere (inside) | Concentric sphere of radius r < R | E = Q*r / (4*pi*eps0*R^3) | Field grows linearly from centre |
| Conducting shell (inside hollow) | Any closed surface inside the cavity | E = 0 | No enclosed charge; shell's field cancels |
Key formulas for the electric field E at distance r, derived by applying Gauss's Law to a symmetrical Gaussian surface.
Frequently asked questions
What does electric flux mean physically?
Electric flux measures how much of the electric field 'passes through' a surface. Imagine the field as a flow of invisible lines radiating from a positive charge; flux counts the total number of those lines that pierce a given closed surface. A larger enclosed charge means more field lines, and thus a larger flux, regardless of the surface's shape or size.
Why is the shape of the Gaussian surface irrelevant?
Gauss's Law proves that the total flux through any closed surface depends only on the enclosed charge, not on the surface's geometry. Whether you draw a sphere, a cube, or an irregular blob around the same charge, the total flux through them is identical. This is why physicists choose the surface shape that makes the integral easiest: a sphere for a point charge, a cylinder for a wire.
How does the calculator handle a dielectric medium?
Toggle the 'Custom permittivity' switch and enter the relative permittivity epsilon_r of your medium. The calculator multiplies epsilon_0 (8.854e-12 F/m) by epsilon_r to get the effective permittivity, then uses it in all formulas. The resulting electric field will be smaller than in vacuum by the factor epsilon_r.
What units should I use for charge?
The calculator accepts nanocoulombs (nC), microcoulombs (uC), millicoulombs (mC), or coulombs (C). Typical laboratory charges in electrostatics experiments are in the nC to uC range. Larger charges in the mC range are found in industrial capacitors, while household static electricity might be a few nC to a few hundred nC.
Can I use this for a charged sphere rather than a point charge?
Yes. Outside a uniformly charged sphere of total charge Q, the electric field is identical to that of a point charge Q at the centre, so the spherical geometry mode gives the exact field for any radius greater than the sphere's radius. For a point inside a uniformly charged non-conducting sphere, the enclosed charge at radius r is Q*(r/R)^3, which you would need to compute manually before entering it as the input.
What is the difference between E (N/C) and flux (N*m^2/C)?
The electric field E is the force per unit charge at a specific point in space (N/C, equivalently V/m). Electric flux Phi = E * A is the product of the field and the area it passes through, measuring the total 'amount' of field threading a surface. Gauss's Law relates the flux (not the field directly) to the enclosed charge: Phi = Q/epsilon. The field is then inferred from the flux and the surface area.