ForHosting KIT · Science

Lens focal length in a medium calculator

See how much a lens weakens under water: a 0.1 m glass lens of index 1.5 in water of index 1.33 stretches to 0.391176470588235 m, and its power falls from 10 to 2.55639097744361 diopters. 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 air
0.1
Lens refractive index
1.5
Medium refractive index
1.33
You get
Focal length air m
0.1
Focal length medium m
0.3911764706
Scale factor
3.9117647059
Optical power air dpt
10

A lens does not retain the same optical power when it moves from air into water, oil, or another transparent material. This calculator uses the focal length measured in air, the refractive index of the lens, and the refractive index of the surrounding medium to compute the new thin-lens focal length. It also reports the change factor, optical power before and after immersion, and whether the immersed lens is converging or diverging. The calculation is deterministic, unit-aware, and suitable for quick laboratory checks, classroom problems, and early optical design estimates.

Why immersion changes a lens focal length

A curved lens bends light because its refractive index differs from that of the material around it. In air, the surrounding refractive index is approximated as one, so ordinary glass has a substantial index contrast and therefore useful optical power. Immersing the same lens in water or oil reduces that contrast when the medium index moves closer to the glass index.

The surfaces then bend rays less strongly, the magnitude of optical power falls, and the focal length becomes longer. This calculator applies the thin-lens lensmaker relationship twice while keeping the surface curvatures fixed. If the surrounding index becomes greater than the lens index, the denominator changes sign.

A lens that converges in air can consequently become diverging in the medium. If the two indices are equal, refraction disappears at the lens surfaces, optical power is zero, and no finite focal length exists; the calculator reports that case as invalid rather than inventing an infinite numeric result.

How to enter values and interpret the result

Refractive index changes with wavelength and, to a lesser degree, environmental conditions, so consistent reference data matters when precision matters. A scale factor greater than one means the signed focal length has been multiplied by that amount; a negative factor indicates that the power direction has reversed. Optical powers are returned in diopters, equal to inverse meters, for both air and the medium.

All inputs must be finite, the focal length in air must be nonzero, and both indices must be positive. The lens index cannot be one because a finite focal length in air would then contradict the thin-lens model. The medium index also cannot exactly match the lens index.

Model limits and practical applications

The calculation assumes a thin lens, fixed spherical surface shapes, air with refractive index one for the original focal-length specification, and the same surrounding medium on both sides of the immersed lens. It is a paraxial result, meaning rays are assumed to stay close to the optical axis and make small angles. A thick element can have principal-plane shifts that this simple conversion does not describe.

Cemented groups, multi-element objectives, asymmetric object and image media, gradient-index optics, and strongly aspheric surfaces require a fuller optical model or ray tracing. Dispersion also means that a result based on one refractive-index pair should not automatically be applied to another wavelength. Within those limits, the formula is valuable for predicting how a laboratory lens behaves in a liquid cell, estimating the power of an underwater camera element, planning microscopy immersion demonstrations, and checking whether an encapsulant will weaken an LED collimator.

It can also serve as a transparent sanity check before detailed simulation: compare the calculated direction and approximate magnitude with a ray-tracing result, then investigate thickness, spacing, or wavelength data when the two disagree. Because no surface radii are needed, the tool is especially convenient when a catalog gives focal length and glass index but not the complete lens prescription.

Plan a liquid-cell experiment

Estimate where a glass singlet will focus after it is submerged in water or index oil before arranging the optical bench.

Check underwater optical behavior

Predict the focal-length and power change of a simple lens element placed behind or inside a uniform surrounding medium.

Evaluate encapsulation effects

Estimate how a transparent resin or potting compound changes the power of a lens used with an LED, sensor, or detector.

What units should I use for focal length?

Enter the focal length in air in meters. The returned focal lengths are in meters, and optical powers are in diopters.

What happens when the lens and medium have the same refractive index?

The surfaces have no refractive power, so the focal length is not finite.

Can immersion turn a converging lens into a diverging lens?

Yes. If the surrounding medium has a refractive index greater than the lens material, the relative index contrast reverses and so can the sign of the optical power.

Does this work for thick or compound lenses?

It is an approximation for a thin lens in one uniform surrounding medium. Thick lenses and multi-element systems need principal-plane analysis or ray tracing.

What does the scale factor in the result tell me?

It is how many times the signed focal length was multiplied by immersion. A factor greater than one means a longer focal length, and a negative factor means the lens has switched between converging and diverging.

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/lens-focal-length-in-medium

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/lens-focal-length-in-medium \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"focal_length_air":0.1,"lens_refractive_index":1.5,"medium_refractive_index":1.33}'
{
  "focal_length_air": 0.1,
  "lens_refractive_index": 1.5,
  "medium_refractive_index": 1.33
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "optics.lens_focal_length_in_medium",
  "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.

Why immersion changes a lens focal length

Eliminating those unknown curvatures gives f_medium = f_air multiplied by (n_lens minus 1), divided by (n_lens divided by n_medium minus 1). That relation is useful because the lens shape does not need to be entered.

How to enter values and interpret the result

Enter focal_length_air in meters, using a positive value for a converging lens and a negative value for a diverging lens. Then provide the dimensionless lens_refractive_index and medium_refractive_index for the wavelength and temperature relevant to your work. The response returns focal_length_medium_m and scale_factor. The behavior_in_medium label states whether the resulting power is converging or diverging. Each successful calculation processes one item and costs $0.002 through the API, while the same deterministic core supports the browser experience.

What formula does the calculator use?

It uses f_medium = f_air × (n_lens − 1) / (n_lens / n_medium − 1), derived from the thin-lens lensmaker equation with unchanged surface curvatures.

How much does an API calculation cost?

Each successful calculation processes one item and costs $0.002.

Read the full KIT documentation →