Gauss's Law Calculator
Use Gauss's law to find electric flux and the electric field of spheres, shells, cylinders, lines, sheets and slabs, inside and outside.
🔵 What is Gauss's Law?
Gauss's law says that the net electric flux through any closed surface equals the total charge enclosed by that surface divided by the permittivity of free space, Φ = Q_enc / ε0. Electric flux measures how much of the electric field passes through a surface, counted as field times area times the cosine of the angle between them. The law is one of Maxwell's four equations. For static charges it is equivalent to Coulomb's law, but it is far easier to use when the charge has a symmetric shape, because a well-chosen imaginary surface turns a difficult integral into a single multiplication.
The calculator has four modes. Flux relates the enclosed charge to the net flux, in either direction. Sphere gives the field inside and outside a uniformly charged solid sphere or a thin shell, together with the charge enclosed by your Gaussian sphere. Cylinder or line does the same for a long uniformly charged cylinder, a cylindrical shell or an infinite line. Plane covers an infinite sheet, the surface of a conductor and a uniformly charged slab. In every mode the chart shows how the field changes with radius or position, with your chosen point marked on it.
Gauss's law is the reason many results in electrostatics are so tidy. The field outside any spherical charge distribution is that of a point charge at the centre, the field inside a hollow conductor is zero, and the field of a large sheet does not depend on how far away you stand. It is used to design shielding, to explain why a charged conductor holds its charge on the surface, and to derive the capacitance of cylindrical and spherical capacitors. The same reasoning applies to gravity, with mass in place of charge.
Some points are easy to get wrong. The law is always true, but it only gives the field when symmetry makes the field constant over the Gaussian surface. Flux depends on enclosed charge only, while the field at a point depends on all charges, inside and outside. The infinite-object formulas are good approximations near the middle of a large object. For a point charge compare the electric field calculator, for the force see the Coulomb's law calculator, and for the uniform field between two plates see the parallel plates calculator.
📐 Formula
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 — Flux from 1 µC
Q = +1 µC inside any closed surface, vacuum
Example 2 — Charge from a Measured Flux
Net flux through a closed surface = 1000 N m²/C, vacuum
Example 3 — Inside a Uniformly Charged Sphere
Solid sphere, Q = 10 nC, R = 5 cm, field point r = 2 cm
Example 4 — Inside a Thin Shell
Thin shell, Q = 10 nC, R = 5 cm, field point r = 2 cm
Example 5 — Outside a Charged Sphere
Solid sphere, Q = 10 nC, R = 5 cm, field point r = 10 cm
Example 6 — Inside a Charged Cylinder
Solid cylinder, λ = 2 µC/m, R = 2 cm, r = 1 cm
Example 7 — Outside the Same Cylinder
Solid cylinder, λ = 2 µC/m, R = 2 cm, r = 10 cm
Example 8 — A Large Charged Sheet
σ = +5 µC/m², x = 0.5 m
Example 9 — Just Outside a Conductor
Conductor surface with σ = +5 µC/m², x = 0.5 m outside
Example 10 — Inside a Charged Slab
Slab with ρ = +1 µC/m³, thickness t = 0.2 m, at x = 0.05 m from the centre
❓ Frequently Asked Questions
🔗 Related Calculators
What is Gauss's law?
Gauss's law states that the net electric flux through any closed surface equals the enclosed charge divided by the vacuum permittivity: flux = Q_enc / eps0, where eps0 = 8.854e-12 F/m. It is one of Maxwell's equations and is equivalent to Coulomb's law for static charges.
How do you calculate electric flux through a closed surface?
Divide the enclosed charge by eps0. For 1 µC enclosed in vacuum, the flux is 1e-6 / 8.854e-12 = 112.9 kN m²/C, whatever the shape or size of the closed surface.
What is the electric field inside a uniformly charged sphere?
For a solid sphere of total charge Q and radius R, E = k Q r / R³ for r less than R. It rises linearly from zero at the centre to k Q / R² at the surface, because the enclosed charge grows as r³.
What is the electric field outside a charged sphere?
Outside, E = k Q / r², exactly as if all the charge were at the centre. This holds for a uniformly charged sphere, a thin shell and a conducting sphere, which is a result of spherical symmetry and Gauss's law.
Why is the electric field zero inside a charged shell?
A Gaussian sphere drawn inside a thin shell encloses no charge, so the flux through it is zero. By symmetry the field has the same size everywhere on that sphere, so the field itself must be zero.
What is the electric field of an infinite line of charge from Gauss's law?
A coaxial cylinder of radius r and length L gives E 2 pi r L = lambda L / eps0, so E = lambda / (2 pi eps0 r). It falls as 1/r and is radial. For a uniformly charged solid cylinder it is lambda r / (2 pi eps0 R²) inside.
What is the electric field of an infinite plane of charge?
A pillbox through the sheet gives 2 E A = sigma A / eps0, so E = sigma / (2 eps0) on both sides, independent of distance. For sigma = 5 µC/m² that is 282.4 kN/C.
Why is the field outside a conductor twice that of a sheet?
A conductor has zero field inside, so a pillbox straddling its surface has flux through only one end cap. That gives E = sigma / eps0 just outside, which is twice the sigma / (2 eps0) of an isolated sheet with the same surface charge density.
What is a Gaussian surface?
It is an imaginary closed surface chosen to match the symmetry of the charges, such as a sphere, a coaxial cylinder or a pillbox. It makes the field constant (or zero) over the surface so the flux integral reduces to E times an area.
Does Gauss's law work for any charge distribution?
Yes, the law is always true, but it only lets you solve for E directly when the symmetry is high enough that E is constant over the chosen surface. For other shapes use superposition or numerical methods.