Gauss's Law Simulator Back
Electromagnetism

Gauss's Law Electric Field Simulator

Calculate and visualize electric fields for infinite line charge, infinite plane, and spherical charge distributions using Gauss's law. Move the Gaussian surface to experience the relationship between enclosed charge and field.

Select Charge Distribution
Line charge density λ (nC/m)
nC/m
Gaussian surface size r (m)
m
Field Strength
Results
E (V/m)
Φ_E (V·m)
Main
Electric Field E(r) vs Distance r
Theory & Key Formulas
$$\oint \mathbf{E}\cdot d\mathbf{A}= \frac{Q_{enc}}{\varepsilon_0}$$

Line charge: $E = \dfrac{\lambda}{2\pi\varepsilon_0 r}$

What is Gauss's Law?

🙋
What exactly is Gauss's Law? I see the integral symbol and it looks intimidating.
🎓
Basically, it's a powerful shortcut. It says the total electric field "flowing out" of a closed surface is proportional to the total charge inside that surface. In practice, for symmetric shapes like the ones in this simulator, it lets us calculate the electric field easily without complicated integrals. Try selecting the "Line Charge" and moving the "Gaussian surface size r" slider. You'll see the cylindrical surface we use to apply the law.
🙋
Wait, really? So for the infinite line charge, the formula is $E = \lambda / (2\pi\varepsilon_0 r)$. How do we get that from the law?
🎓
Great question! We imagine a cylindrical Gaussian surface around the line. The field points radially outward, so it's perpendicular to the cylinder's curved surface. The left side of Gauss's Law becomes $E$ times the area of the cylinder's wall, $E(2\pi r L)$. The enclosed charge is just the charge density $\lambda$ times the length $L$ inside. Cancel $L$ and solve for $E$! You can test this: increase the "Line charge density λ" parameter above and watch the calculated field strength grow.
🙋
That makes sense for lines and cylinders. But what about the sphere? What happens when my Gaussian surface (size r) is smaller than the actual charged sphere's radius (R)?
🎓
Excellent! This is a key insight. For a sphere with total charge Q, if your Gaussian surface is inside (r < R), the enclosed charge is not Q. It's only the charge within that smaller sphere. In the simulator, set the sphere's "Total charge Q" and "Radius R", then slowly drag the "Gaussian surface size r" slider from 0 to a value larger than R. You'll see the field plot change from linear (inside) to the familiar $1/r^2$ drop (outside), all governed by the same law.

Physical Model & Key Equations

The fundamental governing equation is Gauss's Law in integral form. It states that the net flux of the electric field through any closed surface is equal to the net charge enclosed divided by the permittivity of free space.

$$\oint_S \mathbf{E}\cdot d\mathbf{A}= \frac{Q_{enc}}{\varepsilon_0}$$

$\mathbf{E}$: Electric field vector (V/m or N/C)
$d\mathbf{A}$: Differential area vector (points outward normal to the Gaussian surface)
$Q_{enc}$: Total charge enclosed within the surface (C)
$\varepsilon_0$ : Permittivity of free space (~$8.854 \times 10^{-12}$ F/m)

For geometries with high symmetry (line, plane, sphere), the law simplifies to algebraic formulas for the field magnitude. For example, for an infinite line charge with density $\lambda$:

$$E = \frac{\lambda}{2\pi\varepsilon_0 r}$$

$\lambda$: Linear charge density (C/m). This is the "Line charge density λ" parameter in the simulator.
$r$: Perpendicular distance from the line charge (m). This is the "Gaussian surface size r" parameter when the line charge is selected.
The field points radially away from a positive line charge.

Frequently Asked Questions

Changing the shape or size of the Gaussian surface does not change the electric flux (the integral value on the left side) as long as the total charge Q_enc inside the surface remains the same. However, if the symmetry of the surface is broken, the electric field E cannot be taken out of the integral, making the calculation more complex. This simulator only uses Gaussian surfaces that maintain symmetry.
For an infinite line charge, the charge is uniformly distributed along the line, so a coaxial cylindrical surface is chosen as the Gaussian surface. The lateral area of the cylinder is proportional to the radius r, and the electric flux is constant as Q_enc/ε0. Therefore, the electric field E is inversely proportional to the area, and consequently inversely proportional to r.
The length of the arrow represents the strength (magnitude) of the electric field at that location. A longer arrow indicates a stronger electric field, while a shorter arrow indicates a weaker one. The direction of the arrow represents the direction of the electric field (pointing away from positive charges).
When the Gaussian surface is placed outside the charge distribution, the total charge inside the surface is the total charge Q of the distribution, and the electric field behaves as if all the charge were concentrated at the center as a point charge. When placed inside, the charge inside the surface decreases in proportion to the radius, and the electric field weakens in proportion to the radius.

Real-World Applications

Semiconductor Device Design: Engineers use Gauss's Law to analyze electric fields within transistors and diodes. For instance, in a MOSFET, the field in the gate oxide layer is critical for performance and preventing breakdown. CAE tools like ANSYS Maxwell solve the law numerically to optimize these nanoscale structures.

High-Voltage Insulation & Cables: Calculating the radial electric field around a coaxial power cable is a direct application of the spherical/cylindrical symmetry models. Engineers must ensure the field strength stays below the dielectric breakdown limit of the insulation material, which you can explore with the line and sphere models here.

Capacitance Calculation for PCB Traces: The capacitance between two parallel traces on a circuit board is found by relating the electric field (from the charge on one trace) to the voltage. FEM software like COMSOL uses the differential form of Gauss's Law ($\nabla \cdot \mathbf{E} = \rho/\varepsilon_0$) to compute parasitic capacitance that affects signal speed.

Electrostatic Precipitators & Pollution Control: These industrial devices use charged plates and wires to attract dust particles. The electric field between a charged wire (modeled as a line charge) and a cylindrical collection plate is designed using Gauss's Law principles to maximize particle collection efficiency.

Common Misconceptions and Points to Note

When you start using this simulator, there are a few points that are easy to misunderstand. First is the meaning of the word "infinite." Terms like "infinite line charge" or "infinite plane" describe powerful models that don't exist in reality but can be used when the object appears sufficiently long or wide from the observation point. For example, to find the electric field at a point just 1 cm away from the center of a 1-meter long thin wire, you can approximate it using the formula for an "infinite line charge," $E = \frac{\lambda}{2\pi\varepsilon_0 r}$. However, this formula doesn't hold near the ends of the wire. In the simulator, if you try making the "Gaussian surface size r" very large, you can visually see how the field weakens. This is your first step in understanding the limits of "infinite" models.

Next is the "appropriateness" of the Gaussian surface. The law itself holds for any arbitrary closed surface, but if you want to find the electric field E, "symmetry" is crucial. Using a cubic Gaussian surface for a spherically symmetric charge distribution makes the calculation explode in complexity. In the simulator, select "spherical symmetry" and try deliberately moving the Gaussian surface away from being a sphere. You should experience firsthand how the direction and magnitude of the electric field vector vary wildly at different points on the surface, making it impossible to calculate simply as 'E × (area).' Even when using CAE tools in practical work, how you define the mesh (computational grid) is often decided by considering this "symmetry."

Finally, the meaning of "does not exit". Seeing the electric field emanating perpendicularly from an "infinite plane," some people mistakenly think, "There's no electric field 'outside' the plane." That's not correct. Here, "outside" refers to the curved side surface of the cylindrical Gaussian surface we set up. The infinite plane emits a uniform electric field perpendicularly on both sides, but that field is parallel to the cylinder's side surface, so the electric flux through the side is zero. If you have two planes, like capacitor plates, the field between them strengthens to $E = \sigma / \varepsilon_0$. Be sure to confirm this difference in the simulator by changing the value of σ.

How to Use

  1. Select charge distribution type: line charge (λ in C/m), surface charge (σ in C/m²), or point/spherical charge (Q in C)
  2. Enter numeric values in fields lambdaNum, sigmaNum, qNum, or totalQNum depending on geometry
  3. For spherical distributions, specify radius in rSphereNum; for line/plane charges, enter perpendicular distance from source
  4. Click Calculate to compute electric field strength E (V/m) and electric flux Φ_E (V·m)

Worked Example

Coaxial cable analysis: line charge λ = 8.85 × 10⁻¹¹ C/m on copper conductor. At radial distance r = 0.005 m from axis, Gauss's law yields E = λ/(2πε₀r) = 32 V/m. Electric flux through 1 m cylindrical surface: Φ_E = λ/ε₀ = 1.0 V·m. For concentric spherical shell Q = 1.77 × 10⁻¹⁰ C at R = 0.1 m, field E = Q/(4πε₀R²) = 159.2 V/m with total flux Φ_E = Q/ε₀ = 20 V·m.

Practical Notes

  1. Infinite plane approximation valid when measurement distance r ≪ plane dimensions; σ = 2 µC/m² typical for electrostatic shielding, yielding E ≈ 226 kV/m
  2. Spherical symmetry requires uniform charge distribution; eccentric placement invalidates Gauss's law simplification
  3. For cylindrical geometries in transmission lines, use line charge form; distinguish inner conductor (positive λ) from outer sheath (negative λ) to model potential differences
  4. Flux calculation sensitive to ε₀ = 8.854 × 10⁻¹² F/m; verify unit consistency before solving coupled field problems