When designing magnetic triggers, reed switch arrays, or magnetic levitation rigs, guessing the field strength at a distance leads to failed prototypes. A magnet calculator computes the exact magnetic flux density ($B_z$) along the central axis of a cylindrical magnet at any given distance ($z$) from its face. Whether you are sizing a neodymium cylinder to trip a Hall effect sensor at 15 mm or verifying the surface field of a custom SmCo pull-magnet, the underlying physics relies on a single, deterministic equation.

The direct answer for the on-axis magnetic field of a cylinder is derived from the Biot-Savart law applied to a uniform magnetic charge sheet. Below is the complete derivation framework, material data, and step-by-step unit tracking to ensure your calculations match reality.

The Axial Magnetic Field Formula & Symbol Definitions

The magnetic flux density $B_z$ (in Teslas) at a distance $z$ from the face of a cylindrical magnet is calculated using the following equation:

Bz = (Br / 2) × [ (z + L) / √(R² + (z + L)²) − z / √(R² + z²) ]

Every variable in this equation must be expressed in standard SI units (meters and Teslas) before calculating. Mixing centimeters and millimeters is the most common reason online magnet calculators return wildly inaccurate numbers.

Table 1: Formula Symbol Definitions & SI Units
Symbol Definition SI Unit Practical Notes
Bz Magnetic flux density at distance z Tesla (T) 1 T = 10,000 Gauss. Often measured in mT (milliTesla).
Br Remanence (Residual Flux Density) Tesla (T) A fixed material property. Represents the theoretical maximum internal field.
L Length (thickness) of the magnet Meters (m) Measured parallel to the axis of magnetization.
R Radius of the cylindrical magnet Meters (m) Half of the physical diameter. Do not use diameter in the formula.
z Axial distance from the magnet face Meters (m) Distance to the sensor or target. Set to 0 for surface field calculations.

Material Reference: Real-World Remanence (Br) Values

The $B_r$ variable is entirely dependent on your magnet's material grade. Manufacturers specify a range for $B_r$, but for precise calculator inputs, you should use the nominal midpoint. Below is a data-dense reference table for common permanent magnet materials used in DIY and industrial applications.

Table 2: Nominal Remanence Values by Magnet Material
Material / Grade Composition Nominal Br (Tesla) Nominal Br (Gauss) Max Operating Temp
N35 (Neodymium) NdFeB 1.19 T 11,900 G 80°C
N42 (Neodymium) NdFeB 1.32 T 13,200 G 80°C
N52 (Neodymium) NdFeB 1.45 T 14,500 G 65°C
SmCo 2:17 (Grade 26) Samarium Cobalt 1.05 T 10,500 G 300°C
AlNiCo 5 Aluminum-Nickel-Cobalt 1.24 T 12,400 G 540°C
Ceramic 5 (Ferrite) SrO-Fe2O3 0.39 T 3,900 G 250°C

Source reference: Material properties align with standard manufacturer datasheets from suppliers like K&J Magnetics and Dexter Magnetic Technologies.

Boundary Assumptions & Unit Mistakes That Break the Math

This formula models an idealized magnetic circuit. Before plugging numbers into your magnet calculator, verify that your physical setup matches these assumptions:

  • Uniform Magnetization: The magnet must be magnetized perfectly through its thickness (axially). Diametrically magnetized cylinders require a completely different tensor derivation.
  • On-Axis Measurement: The formula only calculates $B_z$ directly on the centerline (Z-axis). Off-axis calculations require elliptic integrals or finite element analysis (FEA).
  • Air Core Environment: The formula assumes the magnetic field is propagating through air ($\mu_r \approx 1$). If your magnet is mounted on a steel backing plate, the plate acts as a flux return, effectively doubling the magnet's thickness ($L$) in the calculation and drastically increasing the forward field strength.
⚠ Critical Unit Traps:

The two most common errors that break this formula are mixing length scales and confusing flux density units.

  • The Meter Trap: If your magnet is 10 mm in radius, $R = 0.01$ m. If you input $R = 10$, the calculator assumes a 10-meter radius magnet, yielding a microscopic field density.
  • The Gauss Trap: Hall effect sensors like the SS49E output data in Gauss, but the SI formula demands Teslas. Remember: $1 \text{ T} = 10,000 \text{ G}$. A 500 G trigger point must be entered as $0.05 \text{ T}$. (For deeper context on SI magnetic units, see the NIST Guide to the SI).

Rearranged Forms for Magnet Sizing

In practical engineering, you rarely know all variables. Usually, you know the sensor's trigger threshold ($B_z$), the distance ($z$), and the material ($B_r$), and you need to solve for the magnet's physical dimensions ($R$ or $L$).

Important Limitation: For any distance $z > 0$, isolating $L$ or $R$ algebraically results in a high-degree polynomial that cannot be solved with simple arithmetic; you must use numerical iteration (like Excel's Goal Seek or a Python script). However, if you are calculating the Surface Field ($z = 0$), the formula simplifies beautifully, allowing exact algebraic rearrangement.

Surface Field Formula ($z=0$): $B_0 = (B_r / 2) \times [ L / \sqrt{R^2 + L^2} ]$

Rearranged Forms (for z = 0 only):

  • Solve for Thickness (L): $L = R / \sqrt{(B_r / (2 \times B_0))^2 - 1}$
  • Solve for Radius (R): $R = L \times \sqrt{(B_r / (2 \times B_0))^2 - 1}$
  • Solve for Remanence (Br): $B_r = (2 \times B_0 \times \sqrt{R^2 + L^2}) / L$

Worked Example 1: Forward Calculation for Sensor Placement

Scenario: You are building a limit switch using an N52 cylindrical magnet. The magnet has a diameter of 12.7 mm and a thickness of 6.35 mm (a standard 1/2" x 1/4" disc). Your linear Hall effect sensor is mounted 10 mm away from the magnet face. What is the magnetic flux density at the sensor?

Step 1: Convert all values to SI units (Meters, Teslas).

  • $B_r$ (N52) = $1.45 \text{ T}$
  • Diameter = $12.7 \text{ mm} \rightarrow R = 6.35 \text{ mm} = 0.00635 \text{ m}$
  • $L = 6.35 \text{ mm} = 0.00635 \text{ m}$
  • $z = 10 \text{ mm} = 0.01 \text{ m}$

Step 2: Calculate the first bracketed term (the far-face contribution).

  • Numerator: $z + L = 0.01 + 0.00635 = 0.01635 \text{ m}$
  • Denominator: $\sqrt{R^2 + (z + L)^2} = \sqrt{0.00635^2 + 0.01635^2} = \sqrt{0.00004032 + 0.00026732} = \sqrt{0.00030764} = 0.01754 \text{ m}$
  • Term 1 = $0.01635 / 0.01754 = 0.9322$

Step 3: Calculate the second bracketed term (the near-face contribution).

  • Numerator: $z = 0.01 \text{ m}$
  • Denominator: $\sqrt{R^2 + z^2} = \sqrt{0.00635^2 + 0.01^2} = \sqrt{0.00004032 + 0.0001} = \sqrt{0.00014032} = 0.011846 \text{ m}$
  • Term 2 = $0.01 / 0.011846 = 0.8442$

Step 4: Combine and solve for Bz.

  • $B_z = (1.45 / 2) \times (0.9322 - 0.8442)$
  • $B_z = 0.725 \times 0.0880$
  • $B_z = 0.0638 \text{ T}$

Result: The field strength at 10 mm is 63.8 mT (or 638 Gauss). This is well above the typical 20 mT threshold required to saturate a standard SS49E sensor.

Worked Example 2: Sizing Magnet Thickness for a Target Surface Field

Scenario: You need a surface magnetic field ($z=0$) of exactly $0.45 \text{ T}$ to reliably actuate a heavy-duty industrial reed switch embedded in a plastic housing. You have constrained space: the magnet cavity only allows a maximum diameter of 20 mm ($R = 10 \text{ mm}$). You are using N42 material. How thick must the magnet be?

Step 1: Define knowns in SI units.

  • Target $B_0 = 0.45 \text{ T}$
  • $B_r$ (N42) = $1.32 \text{ T}$
  • $R = 10 \text{ mm} = 0.01 \text{ m}$

Step 2: Apply the rearranged surface field formula for L.

  • $L = R / \sqrt{(B_r / (2 \times B_0))^2 - 1}$

Step 3: Solve the inner ratio.

  • $B_r / (2 \times B_0) = 1.32 / (2 \times 0.45) = 1.32 / 0.90 = 1.4667$

Step 4: Square the ratio and subtract 1.

  • $(1.4667)^2 - 1 = 2.1512 - 1 = 1.1512$

Step 5: Take the square root and divide R.

  • $\sqrt{1.1512} = 1.0729$
  • $L = 0.01 \text{ m} / 1.0729 = 0.00932 \text{ m}$

Result: You need an N42 magnet that is 20 mm in diameter and 9.32 mm thick to achieve a 0.45 T surface field. (In practice, you would source a standard 20 mm x 10 mm cylinder, which will slightly exceed your target threshold, ensuring reliable actuation).

What a Realistic Answer Magnitude Looks Like

When verifying your magnet calculator outputs, you need a mental model of physical limits to catch decimal errors. According to standard magnetic measurement principles, permanent magnets have hard physical ceilings.

  • Surface Fields ($z=0$): The maximum theoretical surface field of a neodymium magnet is roughly half its $B_r$. For N52 ($B_r = 1.45 \text{ T}$), the absolute maximum surface field (achieved only with an infinitely large radius and thickness) is $0.725 \text{ T}$. If your calculator outputs a surface field of 1.2 T, you have a math error.
  • Distance Decay: Magnetic field strength follows an inverse-cube law ($1/z^3$) in the far-field. If you move from 10 mm to 20 mm away from a small disc magnet, expect the field strength to drop by roughly a factor of 8, not 2.
  • Sensor Thresholds: Standard Hall effect ICs trigger between 2 mT and 10 mT. Industrial reed switches typically require 15 mT to 50 mT. If your calculated $B_z$ at the sensor location is 0.0005 T (0.5 mT), your sensor will not trigger reliably due to Earth's ambient magnetic field noise (~0.05 mT) and electrical interference.

By strictly tracking your SI units and respecting the geometric assumptions of the Biot-Savart derivation, you can bypass expensive FEA software and accurately size magnetic components directly on the workbench.