ForHosting KIT · Science

Combined focal length of lenses in contact calculator

Combines two thin lenses into one: 20 cm and 30 cm in contact act like a single 12 cm converging lens, because their powers add. Use negative values for diverging lenses and one unit throughout. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Focal length 1
20
Focal length 2
30
You get
Equivalent focal length
12
Combined power per unit
0.0833333333
Lens type
converging
Precision
10

This combined focal length calculator finds the equivalent focal length of two thin lenses placed in contact. Enter each signed focal length in the same unit, and it applies the reciprocal rule: one over the equivalent focal length equals one over the first focal length plus one over the second. Positive values represent converging lenses and negative values represent diverging lenses under the usual sign convention. The calculation is deterministic, runs without network access, and reports both the equivalent focal length and combined optical power.

How to enter two focal lengths correctly

Both numbers must use the same length unit. If the first value is 20 centimeters and the second is 30 centimeters, the returned equivalent focal length is also expressed in centimeters. You can instead use millimeters, meters, or inches, provided you do not mix units within one request.

A positive focal length describes a converging thin lens, while a negative focal length describes a diverging thin lens under the standard optical sign convention. Neither input may be zero because its reciprocal would be undefined. An optional precision field controls output rounding from zero through fifteen decimal places.

The calculator returns normalized inputs so you can confirm exactly which values were used. It does not convert units, infer units from labels, or model spacing between the lenses. The lenses are assumed to be thin, coaxial, and in direct contact, which is the condition under which this reciprocal sum rule applies without a separation term.

How the reciprocal sum produces the result

For thin lenses in contact, optical powers add. For two positive lenses, the equivalent focal length is positive and shorter than either individual focal length because the combination is more strongly converging. A positive and negative lens may yield either a positive or negative result, depending on which optical power has the greater magnitude.

If their powers cancel exactly, the pair is afocal: the reciprocal sum is zero and no finite equivalent focal length exists. The response labels a finite positive result as converging and a finite negative result as diverging. Rounding is applied only to output fields after the core reciprocal calculation, negative zero is normalized to zero, and a precision that would erase a nonzero focal length is rejected.

When this approximation is useful and where it stops

The contact-lens approximation is useful in introductory optics, laboratory planning, quick checks of compound lens power, and software that needs a reproducible textbook calculation. Students can verify exercises involving two converging lenses or a converging-diverging pair before drawing ray diagrams. Teachers can generate answer keys with consistent signs and decimal precision.

The result should not be treated as a complete model of a real multi-element objective. If lenses have meaningful axial separation, the system power includes an additional distance-dependent term, and principal planes no longer coincide with the contact plane. Thick lenses, refractive-index transitions, lens orientation, aberrations, aperture stops, wavelength dependence, and manufacturing tolerances are also outside this calculation.

For those systems, use ray-transfer matrices or optical design software with the actual geometry and materials. Here, every accepted request performs one narrowly defined operation with no network calls, storage, randomness, or current-time dependency.

Check optics homework

Verify the equivalent focal length and sign of two thin lenses in contact before completing a ray diagram.

Estimate a contact pair

Make a quick first-pass power estimate for two coaxial elements when their separation can be neglected.

What does the calculator cost?

It is free to use in the browser.

Can one focal length be negative?

Yes. Use a negative signed focal length for a diverging lens under the standard sign convention.

Does this work for separated or thick lenses?

No. It assumes two thin lenses in contact; separated or thick systems require a model that includes geometry and principal planes.

What is the combined focal length of a 20 cm and a 30 cm lens in contact?

12 cm. Add the reciprocals, 1/20 plus 1/30, which equals 1/12, then flip the sum. Both lenses are converging, so the pair is converging too.

Can I mix centimetres and millimetres for the two lenses?

No. Enter both focal lengths in the same unit, and the result comes back in that unit. The calculator does not convert units or read them from labels.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/optics/combined-focal-lenses-contact

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/optics/combined-focal-lenses-contact \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"focal_length_1":20,"focal_length_2":30}'
{
  "focal_length_1": 20,
  "focal_length_2": 30
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "optics.combined_focal_lenses_contact",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Use it free in the browser or automate each successful API calculation for $0.002.

How to enter two focal lengths correctly

Enter the signed focal length of the first lens as focal_length_1 and that of the second lens as focal_length_2. Decimal strings and scientific notation are accepted when they represent finite numbers, and the short aliases f1 and f2 are available for compact integrations.

How the reciprocal sum produces the result

Because optical power is the reciprocal of focal length in a consistent unit, the engine evaluates 1/f = 1/f1 + 1/f2 and then takes the reciprocal to obtain the equivalent focal length. The same relation can be rearranged as f = f1 times f2 divided by f1 plus f2, but calculating the reciprocal sum directly keeps the reported combined_power_per_unit aligned with the defining rule. That case returns invalid_input instead of Infinity. These rules keep JSON output stable while avoiding a misleading zero result.

When this approximation is useful and where it stops

Browser calculations are free, while a successful API request costs $0.002, making the same calculation suitable for both interactive study and repeatable automation.

Build deterministic test fixtures

Generate stable combined-focal-length outputs for educational software, calculators, and continuous-integration tests.

Which formula is used?

It uses 1/f = 1/f1 + 1/f2, where all focal lengths use the same unit.

What happens when the lens powers cancel?

The pair is afocal and has no finite equivalent focal length, so the request returns invalid_input.

Read the full KIT documentation →