The symbol B appears in half the chapters of class 12 physics, and students often carry three or four formulas for it without knowing when to use which. Let us put the formulas in one place, with units and with numbers you can sanity-check.

Around a straight wire, B falls as 1/r and grows with the current

Unit of magnetic field

The SI unit is the tesla (T). It is defined through the force on a moving charge: F = qvB. One tesla is the field in which a charge of 1 C moving at 1 m/s perpendicular to the field feels a force of 1 N. So 1 T = 1 N/(A m).

1 T = 10⁴ gauss   |   1 gauss = 10⁻⁴ T   |   dimensions of B: [M T⁻² A⁻¹]

For a feel of the scale: Earth's field is 25–65 μT (0.25–0.65 gauss), a fridge magnet is about 5 mT, and a hospital MRI machine is 1.5–3 T.

The formulas you need

All of them contain μ₀ = 4π × 10⁻⁷ T m/A, the permeability of free space.

SourceFieldWhere
Long straight wireB = μ₀I / 2πrAt distance r from the wire
Circular loop (N turns)B = μ₀NI / 2RAt the centre
Long solenoidB = μ₀nIInside, n = turns per metre
ToroidB = μ₀NI / 2πrInside the ring

Worked numericals

Straight wire: I = 10 A, r = 5 cm. B = 4π × 10⁻⁷ × 10 / (2π × 0.05) = 4 × 10⁻⁵ T = 0.4 gauss. That is about the same as Earth's own field, which is why a compass near a heavy current gets confused.
Circular coil: N = 100 turns, R = 10 cm, I = 2 A. B = 4π × 10⁻⁷ × 100 × 2 / (2 × 0.1) ≈ 1.26 × 10⁻³ T.
Solenoid: 5000 turns per metre, I = 2 A. B = 4π × 10⁻⁷ × 5000 × 2 ≈ 1.26 × 10⁻² T = 12.6 mT. Doubling the current doubles B. Putting in an iron core multiplies it by the relative permeability, often hundreds of times.

Force by the field

On a moving charge: F = qvB sinθ. An electron at 10⁶ m/s across a 0.1 T field feels F = 1.6 × 10⁻¹⁹ × 10⁶ × 0.1 = 1.6 × 10⁻¹⁴ N. It looks tiny, but for an electron's mass this is an enormous acceleration, and the electron goes in a circle of radius r = mv/qB.

Between two parallel wires, the force per unit length is F/l = μ₀I₁I₂ / 2πd. For 10 A in each wire, 10 cm apart, this is 2 × 10⁻⁴ N/m. Currents in the same direction attract. This formula is how the ampere is defined.

Quick checks before you write the answer

Is r in metres? Is n turns per metre and not total turns? Did you use the right-hand rule to fix the direction? A final unit check is cheap: μ₀ × A / m gives T m/A × A / m = T.

Try it yourself

Biot-Savart Law Magnetic Field of a Conductor Electromagnet