Focal Length Calculator Formula

Understand the math behind the focal length calculator. Each variable explained with a worked example.

Formulas Used

Focal Length

focal_length = 1 / (1/object_distance + 1/image_distance)

Lens Power

lens_power = 100 / (1 / (1/object_distance + 1/image_distance))

Variables

VariableDescriptionDefault
object_distanceObject Distance(cm)30
image_distanceImage Distance(cm)15

How It Works

Focal Length

The focal length defines the converging or diverging power of a lens or mirror.

Formula

1/f = 1/d_o + 1/d_i

Lens power in diopters is D = 1/f (with f in meters). Positive focal length = converging lens; negative = diverging.

Worked Example

An object at 30 cm produces an image at 15 cm.

object_distance = 30image_distance = 15
  1. 011/f = 1/do + 1/di
  2. 021/f = 1/30 + 1/15
  3. 031/f = 0.0333 + 0.0667 = 0.1
  4. 04f = 10 cm
  5. 05Power = 100/10 = 10 diopters

Ready to run the numbers?

Open Focal Length Calculator