How to use the Lens & Mirror Formula Calculator
- Pick the device: convex lens, concave lens, concave mirror or convex mirror.
- Choose what to solve for (v, u or f) and the length unit, then type the other two distances. Signs follow the NCERT convention, and the tool fixes the sign of u and f for you.
- Optionally enter the object height, or tap a standard position such as “Between F and 2F” to place the object.
- Read v (or u, f), magnification, image height, power and whether the image is real or virtual, erect or inverted, magnified or diminished.
- Check the to-scale ray diagram and the highlighted row of the NCERT image-formation table.
Lens formula and mirror formula
Both formulas link the object distance u, the image distance v and the focal length f. With the sign convention used in NCERT textbooks they are:
The two look different only because of the sign convention. Learn the convention and both work for every case: convex or concave, real or virtual image.
The New Cartesian sign convention (NCERT)
- The object is placed to the left, so incident light travels from left to right.
- All distances are measured from the optical centre O of a lens or the pole P of a mirror.
- Distances in the direction of the incident light (to the right) are positive; distances against it (to the left) are negative. So u is negative for a real object.
- Heights above the principal axis are positive; heights below it are negative.
- Results: convex lens f > 0, concave lens f < 0, concave mirror f < 0, convex mirror f > 0. For a mirror, f = R/2.
Reading the answer: for a lens, v > 0 means a real image on the far side and v < 0 means a virtual image on the object side. For a mirror, v < 0 means a real image in front of the mirror and v > 0 means a virtual image behind it. In both cases a negative m means inverted, a positive m means erect, and |m| > 1 means magnified.
Worked examples
Convex lens, f = +20 cm, object 30 cm away (u = −30 cm): 1/v = 1/f + 1/u = 1/20 − 1/30 = 1/60, so v = +60 cm. m = v/u = 60/(−30) = −2. The image is real, inverted and twice the size. Power P = 1/0.20 m = +5 D.
Concave mirror, f = −20 cm, u = −30 cm: 1/v = 1/f − 1/u = −1/20 + 1/30 = −1/60, so v = −60 cm (in front of the mirror). m = −v/u = −(−60)/(−30) = −2: real, inverted, magnified.
Convex mirror, f = +15 cm, u = −20 cm: 1/v = 1/15 + 1/20 = 7/60, so v ≈ +8.57 cm (behind the mirror) and m ≈ +0.43: virtual, erect, diminished. This is why convex mirrors are used as rear-view mirrors: they always give an erect, smaller image and a wider field of view.
Concave lens, f = −15 cm, u = −30 cm: 1/v = −1/15 − 1/30 = −1/10, so v = −10 cm and m = +1/3: virtual, erect, diminished. A concave lens always gives this kind of image for a real object.
Power of a lens
Power measures how strongly a lens converges or diverges light: P = 1/f with f in metres, measured in dioptres (D). A convex lens has positive power and a concave lens negative power. For thin lenses in contact, the powers add: P = P₁ + P₂ + … An optician’s prescription of −2.0 D is a concave lens of focal length −0.5 m, used to correct myopia.
Common mistakes
- Dropping the minus sign on u. For a real object u is always negative. Writing u = +30 is the most common reason for a wrong answer.
- Mixing up the formulas. Lens: minus sign (1/v − 1/u). Mirror: plus sign (1/v + 1/u). Magnification for a mirror has an extra minus sign.
- Forgetting units in power. Convert f to metres first: f = 25 cm gives P = 1/0.25 = 4 D, not 1/25.
- Adding fractions wrongly. Use a common denominator, such as 1/20 − 1/30 = (3 − 2)/60 = 1/60, then flip to get v. A fraction calculator helps you check.
Exam tips
- Draw at least two rays: one parallel to the axis (which passes through, or appears to come from, F) and one through the optical centre or pole. Where they meet is the image.
- Object at F of a converging lens or mirror gives an image at infinity. Object at 2F (or C) gives a same-size image at 2F (or C).
- Check your answer’s sign against the table: if a concave lens gives a real image, a sign has gone wrong.
Frequently asked questions
What is the difference between the lens formula and the mirror formula?
Why is u always negative?
How do I know if the image is real or virtual from v?
What does a negative magnification mean?
How do you calculate the power of a lens?
Where should the object be for a magnified real image?
Can a convex mirror form a real image?
Last reviewed November 2026. Results are estimates for information only — see our disclaimer.