In magnetic flux you counted how much magnetic field passes through a loop: $\Phi_B = BA\cos\theta$. Electric flux is the same idea for $\vec{E}$. It will be the key to Gauss's law, which turns hard field integrals into one-line answers.
Key idea
Give each small patch of surface a vector $d\vec{A}$: its area, pointing along the patch's normal (perpendicular to the surface). Then
$$\Phi_E = \int \vec{E}\cdot d\vec{A}.$$
For a uniform field and a flat surface, $\Phi_E = EA\cos\theta$, with $\theta$ the angle between $\vec{E}$ and the normal. Units: N·m²/C. On a closed surface the normals point outward, so field leaving counts as positive and field entering as negative.
Why it works
Only the part of $\vec{E}$ that crosses the surface carries anything through it; the part skimming along the surface carries nothing. The dot product $\vec{E}\cdot d\vec{A} = E\,dA\cos\theta$ picks out exactly the crossing part. Think of rain and a window: held flat under the rain it catches the most, tilted it catches less, and held edge-on it catches none.
Worked examples
Worked example: A tilted square
A uniform field of $500\ \text{N/C}$ passes through a square $20\ \text{cm}$ on a side. The field makes a $30^\circ$ angle with the surface of the square. Find the flux.
- The formula needs the angle to the normal. The normal is $90^\circ$ from the surface, so $\theta = 90^\circ - 30^\circ = 60^\circ$.
- $A = (0.20\ \text{m})^2 = 0.040\ \text{m}^2$.
- $\Phi_E = EA\cos\theta = (500)(0.040)\cos 60^\circ = 10\ \text{N·m}^2/\text{C}$.
Answer: $\Phi_E = 10\ \text{N·m}^2/\text{C}$
Worked example: A field that changes across the surface
A field points along $+z$ with $E_z = cy$, $c = 200\ \text{N/(C·m)}$. Find the flux through the rectangle $0 \le x \le 0.30\ \text{m}$, $0 \le y \le 0.20\ \text{m}$ in the $xy$-plane.
- The field is not uniform, so integrate. Along a thin strip at height $y$ the field is constant, and the strip's area is $dA = (0.30)\,dy$. The field is along the normal, so $\cos\theta = 1$.
- $$\Phi_E = \int_0^{0.20} cy\,(0.30)\,dy = (0.30)\,c\,\frac{(0.20)^2}{2}$$
- $\Phi_E = (0.30)(200)(0.020) = 1.2\ \text{N·m}^2/\text{C}$.
Answer: $\Phi_E = 1.2\ \text{N·m}^2/\text{C}$
Worked example: A closed box in a uniform field
A uniform field points along $+x$. What is the net flux out of a closed cube with its faces along the axes?
- On the face where the field enters, the outward normal points against the field: flux $-EA$.
- On the opposite face the outward normal points along the field: flux $+EA$.
- On the other four faces the field skims the surface: flux $0$. Total: $0$. Every line that goes in comes out.
Answer: $0$
Common mistake
Using the angle to the surface. In the first example, $\cos 30^\circ$ would give $17.3\ \text{N·m}^2/\text{C}$ instead of $10$. The formula's $\theta$ is measured from the normal. A quick check: when the field runs parallel to the surface, nothing passes through, so the flux must be zero; only the angle to the normal (then $90^\circ$) makes $\cos\theta = 0$.