Back to Physics calculators

Lens & Mirror Equation — with steps and ray diagram

Solve the thin lens and spherical mirror equation in classroom-ready form: compute image distance dᵢ, magnification, and image height while the ray diagram updates in sync with every change.

Designed for optics classes and homework checks, the workspace keeps the sign convention visible, records the derivation steps, and exports CSV when you need a quick lab or worksheet handout.

Other languages 日本語 | English | 简体中文 | 繁體中文 | 繁體中文(香港) | Español | Español (LatAm) | Español (México) | Português (Brasil) | Português (Portugal) | Bahasa Indonesia | Tiếng Việt | 한국어 | Français | Deutsch | Italiano | Русский | हिन्दी | العربية | বাংলা | اردو | Türkçe | ไทย | Polski | Filipino | Bahasa Melayu | فارسی | Nederlands | עברית | Čeština
Inputs
Advanced: Lensmaker & mirror radius helpers

Provide n, R₁, and R₂ to compute the lensmaker focal length f = 1 / ((n−1)(1/R₁ − 1/R₂)). For mirrors, the helper reports f = R/2.

Keyboard shortcuts: Ctrl+Enter runs the calculation, Ctrl+S exports the CSV, Ctrl+L copies the share URL.

Result summary

How it's calculated

    Ray diagram

    The canvas plots the optical axis, focal points, object arrow, image arrow, and the three principal rays. Virtual rays are dashed for easy differentiation.

    How to use this calculator effectively

    Pick the correct device first: lens or mirror, then choose whether it is converging/concave or diverging/convex. Enter focal length, object distance, and object height to see the image position, magnification, and ray diagram update together.

    How it works

    The calculator applies the thin lens or spherical mirror equation with the Gaussian sign convention. It then derives image distance, magnification, and image height from the same solved state so the numeric results and ray diagram stay consistent.

    When to use

    Use it for classroom demonstrations, homework checks, and quick optics intuition. It is especially useful when you want to compare how sign changes, object position, or focal length affect whether the image is real, virtual, upright, or inverted.

    Common mistakes to avoid

    Interpretation and worked example

    For a converging lens with the object outside the focal length, the image distance becomes positive and the image is real. Move the object inside the focal length and the result flips to a virtual upright image, which is a fast way to check whether your sign choices make physical sense.

    See also

    FAQ

    How do I know if the image is real or virtual?

    The sign convention follows the Gaussian Cartesian rule: dᵢ > 0 indicates a real image on the outgoing side, whereas dᵢ < 0 marks a virtual image on the object side. The magnification sign shows whether the image is upright (m > 0) or inverted (m < 0).

    What ray diagram does the tool draw?

    We plot the parallel ray through the focus, the ray that heads toward the focus and exits parallel, and the central ray. Dashed segments denote virtual extensions so diverging lenses and convex mirrors remain easy to follow.

    What should I check first after I enter values?

    Confirm the selected element type and the focal-length sign first, then check whether the ray diagram and the real/virtual label agree with the same scenario.

    Why does this page differ from another tool?

    Different pages often use different defaults, units, rounding rules, or assumptions. Align those settings before comparing outputs. If differences remain, compare each intermediate step rather than only the final number.

    How reliable are the displayed values?

    Values are computed in the browser and rounded for display. They are good for planning and educational checks, but for regulated or high-stakes decisions you should validate assumptions with official guidance or professional review.

    Reading the result like an optics student

    What this calculator shows

    You get one solved state shared across the numeric summary, step log, and ray diagram. That makes it easier to connect the algebraic equation to the geometric picture instead of treating them as separate exercises.

    Input meaning and sign policy

    Keep all distances in the same unit. The subtype selector controls the sign of the focal length, while the solved image distance and magnification sign tell you whether the image is real or virtual, upright or inverted.

    Suggested study sequence

    Start with a converging lens or concave mirror, place the object outside the focal point, and confirm the real image case. Then move the object inside the focal length or switch to a diverging element to see how the classification changes.

    Common mistakes to avoid

    Do not compare ray diagrams from different sign conventions without checking the setup first. If the picture looks wrong, verify the selected subtype before assuming the formula failed.

    Interpretation guidance

    Use the image distance sign, the magnification sign, and the dashed-ray geometry together. When all three agree, the result is usually set up correctly and ready for note-taking or export.

    How it’s calculated

    • We solve the thin-lens or mirror equation with the Gaussian sign convention and then derive magnification from m = −dᵢ/dₒ.
    • The summary reports image distance, image height, and real/virtual plus upright/inverted classification from one consistent solve.
    • The ray diagram uses the same solved geometry, so the plotted rays and the numeric result stay in sync.