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.

🔵 Gauss's Law Calculator
Medium
Relative permittivity (εr)
Solve for
Enclosed charge (Q)
Net flux (Φ)
Sphere type
Total charge (Q)
Sphere radius (R)
Field point from the centre (r)
Cylinder type
Charge per length (λ)
Cylinder radius (R)
Distance from the axis (r)
Plane type
Surface charge density (σ)
Volume charge density (ρ)
Slab thickness (t)
Position x (negative on the other side)
Flux through the surface
—
Net flux Φ
—
Enclosed charge
—
Per face of a cube
—
Elementary charges
—
Direction of net flux
—

Electric field |E|
—
Region
—
Direction
—
Enclosed charge
—
Flux through the Gaussian sphere
—
Field at the surface
—
Formula used
—

Electric field |E|
—
Region
—
Direction
—
Enclosed charge per length
—
Flux per metre of length
—
Field at the surface
—
Formula used
—

Electric field |E|
—
Direction
—
Region
—
Formula used
—
Maximum field
—

🔵 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

Φ  =  ∯ E · dA  =  Qenc / ( ε0 εr )
Φ = net electric flux through the closed surface (N m²/C); Qenc = enclosed charge (C)
ε0 = 8.8541878188 × 10-12 F/m (CODATA 2022); εr = relative permittivity of the medium; k = 1/(4πε0)
Sphere: E = k Q r / R³ for r < R (solid), E = 0 for r < R (thin shell), E = k Q / r² for r ≥ R
Cylinder (λ per metre): E = λ r / (2πε0 R²) for r < R (solid), E = 0 (shell), E = λ / (2πε0 r) for r ≥ R and for a line
Sheet: E = σ / (2ε0); conductor surface: E = σ / ε0 outside, 0 inside
Slab (thickness t): E = ρ x / ε0 for |x| ≤ t/2, E = ρ t / (2ε0) outside
Example: 1 µC in vacuum gives Φ = 112.9 kN m²/C through any closed surface

📖 How to Use This Calculator

Steps

1
Choose the symmetry. Flux relates charge and flux directly. Sphere, Cylinder or line and Plane give the field for spherical, cylindrical and planar charge distributions.
2
Enter the charge and the size. Type the total charge or charge density with its unit (the unit menu only labels the number), the radius or thickness, and the point where you want the field. Pick a medium if it is not vacuum.
3
Read the field, the enclosed charge and the chart. The calculator reports the region, the field and direction, the charge enclosed by your Gaussian surface and the flux through it. The chart shows E against radius or position.

💡 Example Calculations

Example 1 — Flux from 1 µC

Q = +1 µC inside any closed surface, vacuum

1
Φ = Q / ε0 = 1 × 10-6 / 8.8541878188 × 10-12
2
Φ = 112.9 kN m²/C (112940.9 N m²/C), outward because the charge is positive
3
If the charge sits at the centre of a cube each face carries one sixth, 18.82 kN m²/C. The charge is 6.242e12 elementary charges.
Flux = 112.9 kN m²/C
Try this example →

Example 2 — Charge from a Measured Flux

Net flux through a closed surface = 1000 N m²/C, vacuum

1
Q = ε0 Φ = 8.8541878188 × 10-12 × 1000
2
Q = 8.854 nC, positive because the flux is outward
3
This is how a charge can be measured without looking inside: only the total flux through the surface matters.
Enclosed charge = 8.854 nC
Try this example →

Example 3 — Inside a Uniformly Charged Sphere

Solid sphere, Q = 10 nC, R = 5 cm, field point r = 2 cm

1
Enclosed charge = Q (r / R)³ = 10 nC × 0.4³ = 640.0 pC
2
E = k Q r / R³ = 8.98755 × 109 × 10-8 × 0.02 / 0.05³ = 14.38 kN/C
3
The flux through the 2 cm Gaussian sphere is 640.0 pC / ε0 = 72.28 N m²/C, and the field at the surface is 35.95 kN/C.
Field = 14.38 kN/C (outward)
Try this example →

Example 4 — Inside a Thin Shell

Thin shell, Q = 10 nC, R = 5 cm, field point r = 2 cm

1
The Gaussian sphere of radius 2 cm lies inside the shell, so it encloses 0 C.
2
The flux is zero and, by symmetry, the field is the same everywhere on the sphere, so E = 0.
3
The same is true inside a conducting sphere, which is why a metal enclosure shields its inside from static fields.
Field = 0 N/C
Try this example →

Example 5 — Outside a Charged Sphere

Solid sphere, Q = 10 nC, R = 5 cm, field point r = 10 cm

1
The Gaussian sphere encloses all the charge, 10 nC.
2
E = k Q / r² = 8.98755 × 109 × 10-8 / 0.1² = 8.988 kN/C
3
This is the same as a point charge of 10 nC at the centre, and it falls to a quarter at twice the distance.
Field = 8.988 kN/C (outward)
Try this example →

Example 6 — Inside a Charged Cylinder

Solid cylinder, λ = 2 µC/m, R = 2 cm, r = 1 cm

1
Enclosed charge per length = λ (r / R)² = 2 µC/m × 0.25 = 500.0 nC/m
2
E = 2 k λ r / R² = 2 × 8.98755 × 109 × 2 × 10-6 × 0.01 / 0.02² = 898.8 kN/C
3
At the surface (r = R) the field reaches 1.798 MN/C.
Field = 898.8 kN/C (outward)
Try this example →

Example 7 — Outside the Same Cylinder

Solid cylinder, λ = 2 µC/m, R = 2 cm, r = 10 cm

1
The coaxial Gaussian cylinder encloses the full λ = 2 µC/m.
2
E = 2 k λ / r = 2 × 8.98755 × 109 × 2 × 10-6 / 0.1 = 359.5 kN/C
3
The field falls as 1/r outside, so it is half as strong at 20 cm.
Field = 359.5 kN/C (outward)
Try this example →

Example 8 — A Large Charged Sheet

σ = +5 µC/m², x = 0.5 m

1
The pillbox has two end caps, so 2 E A = σ A / ε0
2
E = σ / (2ε0) = 5 × 10-6 / (2 × 8.8541878188 × 10-12) = 282.4 kN/C
3
At x = 0.5 m on the positive side the field points toward +x, away from the sheet.
Field = 282.4 kN/C toward +x
Try this example →

Example 9 — Just Outside a Conductor

Conductor surface with σ = +5 µC/m², x = 0.5 m outside

1
The field inside the conductor is zero, so a pillbox straddling the surface has flux through one end cap only: E A = σ A / ε0
2
E = σ / ε0 = 5 × 10-6 / 8.8541878188 × 10-12 = 564.7 kN/C
3
This is twice the 282.4 kN/C of an isolated sheet with the same σ, because all of the flux leaves through one face instead of being shared between two sides.
Field = 564.7 kN/C toward +x
Try this example →

Example 10 — Inside a Charged Slab

Slab with ρ = +1 µC/m³, thickness t = 0.2 m, at x = 0.05 m from the centre

1
The pillbox of half-height x = 0.05 m encloses ρ A x, so the flux gives E = ρ x / ε0
2
E = 10-6 × 0.05 / 8.8541878188 × 10-12 = 5.647 kN/C
3
The field grows linearly to 11.29 kN/C at the slab faces (x = 0.1 m) and stays at that value outside.
Field = 5.647 kN/C toward +x
Try this example →

❓ Frequently Asked Questions

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.

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.