Lens Maker Equation Calculator

Use the lensmaker equation to compute a lens focal length (or solve for n, R1, or R2) with unit-safe inputs, planar-surface toggles, and clear sign help. Get focal length, 1/f, and optical power in diopters for thin or thick lens models.

Advanced options
Model and medium
Planar surfaces
Calculatingโ€ฆ
Focal length f
–
Optical power
–
Reciprocal focal length 1/f
–
Relative refractive index n_relative
–
Sign convention reminder
–
Warnings or notes
–
Did we solve your problem today?

How to use our Lens Maker Equation Calculator

  1. Pick Solve for: focal length f, refractive index n, radius R1, or radius R2.
  2. Select the Length unit you want to use for R1, R2, thickness d, and focal length f (mm, cm, or m).
  3. When solving for n, R1, or R2, enter the known focal length f in that same unit.
  4. Enter Refractive index n (lens material), unless n is the value you selected to solve.
  5. Enter Radius R1 and Radius R2 using the sign convention shown in the results, except for the radius you selected to solve. If an input surface is flat, use its planar toggle instead of typing a huge radius.
  6. Open Advanced options and choose Lens model: Thin lens (d = 0) or Thick lens (uses thickness d).
  7. If using Thick lens, enter the Lens thickness d (center thickness). Keep all lengths in the same unit.
  8. If the lens is not in air, set n_medium (for air, use 1.00). The calculator uses n_relative = n_lens / n_medium.
  9. Choose Number display (Auto, Plain, or Scientific) if your values are very large/small.
  10. Click Calculate. The first result is the value selected under Solve for. If you see an error or N/A, fix the input named in the message and calculate again.

Definitions

Lensmaker equation: A formula that links a lens focal length to the lens material index and the curvatures of its two surfaces (thin or thick lens forms). [1]

Focal length (f): Distance from the lens to where parallel rays would focus (converging lens) or appear to come from (diverging lens). The sign of f depends on the sign convention. [1]

Refractive index (n): A unitless number that tells how much a material slows light compared to vacuum. [2]

Relative refractive index (n_relative): n_lens divided by n_medium. This is what matters when the lens is surrounded by something other than air. [2]

Radius of curvature (R1, R2): The radius of the sphere that best matches a lens surface near the center. Flat (planar) means 1/R = 0.

Optical power (P): P = 1/f_in_meters, measured in diopters (1/m). Positive power is converging; negative is diverging. [1]


Methodology

What this calculator assumes

The lensmaker equation used here is for a lens with two spherical surfaces. You can use the thin-lens model (d = 0) or include center thickness d (thick-lens correction). The surrounding medium is handled with a relative refractive index. [1] [2]

Sign convention used (how to pick +R or -R)

Light is assumed to travel from left to right. R1 is the first surface the light hits; R2 is the second surface.

Rule of thumb: if the center of curvature for a surface is to the right of that surface (in the direction light travels), that radius is positive; if it is to the left, it is negative. If your focal length sign looks flipped from what you expect, double-check the signs of R1 and R2 first. [1]

Planar surface: C = 1/R = 0

Step 1: Convert to relative refractive index

n_relative = n_lens / n_medium

If n_medium is 1.00 (air), then n_relative = n_lens. If n_relative = 1, then the lens has no focusing power in that medium and 1/f = 0. [2]

Step 2: Use curvature (C = 1/R) safely

To avoid divide-by-zero and to support planar faces, the calculator works with curvature values.

C1 = 0 if R1 is planar; otherwise C1 = 1/R1

C2 = 0 if R2 is planar; otherwise C2 = 1/R2

If a required non-planar radius is 0, the calculator blocks the calculation (division by zero).

Step 3: Lensmaker equation (thin or thick)

Thin lens model (d = 0): [1]

1/f = (n_relative - 1) * (C1 - C2)

Thick lens model (uses d): [2]

1/f = (n_relative - 1) * (C1 - C2 + ((n_relative - 1) * d * C1 * C2) / n_relative)

Because this form uses C1 and C2, if either face is planar then C1*C2 = 0 and the thickness correction term becomes 0 automatically.

Step 4: Solve for the selected unknown

Let A be the target reciprocal focal length (A means 1/f in the selected length unit).

A = (n_relative - 1) * (C1 - C2) (thin)

A = (n_relative - 1) * (C1 - C2 + ((n_relative - 1) * d * C1 * C2) / n_relative) (thick)

Solve for f: compute A, then f = 1/A. If A = 0, report f as infinite (no focusing power).

Solve for n: the calculator solves for n_relative, then converts back using n_lens = n_relative * n_medium. If the result would make n_lens less than or equal to 0, it reports an error.

Solve for R1 or R2: the calculator solves for curvature C1 or C2 first, then converts back with R = 1/C. If the algebra gives no unique solution (for example a zero denominator), it reports N/A with a short explanation.

Step 5: Optical power (diopters)

The focal length for diopters must be in meters.

P = 1/f_m

Unit conversion used:

mm to m = 0.001, cm to m = 0.01, m to m = 1.

Outputs and interpretation

Focal length f: positive usually means a converging lens; negative usually means a diverging lens (with the sign convention above). [1]

Reciprocal focal length 1/f: helps you see weak lenses; values near 0 mean very large |f|.

Warnings or notes: shows errors (blocked calculation), N/A cases (no unique solution), and special cases like n_relative = 1 (infinite focal length).


Sources