Lens and Mirror Formula Calculator

Ray optics numericals use the lens formula 1/v − 1/u = 1/f and the mirror formula 1/v + 1/u = 1/f. Enter the object distance and focal length with signs to get the image position, magnification and whether the image is real or virtual.

How it is calculated

Choose lens or mirror.

Enter u (usually negative) and f with its sign.

Read v, m and the image nature.

Formula

Lens: 1/v − 1/u = 1/f, m = v/u

Mirror: 1/v + 1/u = 1/f, m = −v/u

What is the Lens and Mirror Formula Calculator?

This calculator solves the two core equations of ray optics: the lens formula 1/v − 1/u = 1/f and the mirror formula 1/v + 1/u = 1/f. You choose a lens or a mirror, enter the object distance u and the focal length f with their signs, and it returns the image distance v, the magnification m and a plain description of the image: real or virtual, inverted or erect, magnified or diminished. For lenses it also gives the power in dioptres.

It follows the New Cartesian sign convention used in NCERT Class 10 and Class 12 textbooks and in board exams, JEE and NEET. The same maths explains how a projector throws a big picture on a screen, why a shaving mirror magnifies your face and how a spectacle prescription in dioptres relates to focal length.

How to calculate it by hand

1. Place the object to the left and measure all distances from the optical centre of the lens or the pole of the mirror.

2. Apply the sign convention: distances in the direction of incident light are positive, those against it are negative. A real object in front is therefore at negative u.

3. Give f its sign: convex lens and convex mirror positive, concave lens and concave mirror negative.

4. For a lens, find v from 1/v = 1/f + 1/u, and the magnification from m = v ÷ u.

5. For a mirror, find v from 1/v = 1/f − 1/u, and the magnification from m = −v ÷ u.

6. Read the image: for a lens, positive v means real; for a mirror, negative v means real. Negative m means inverted, and |m| greater than 1 means magnified.

7. For a lens, find power P = 1 ÷ f in metres, or 100 ÷ f with f in cm, in dioptres.

Why the signs matter

A single formula can cover every case only if distances carry signs. In the New Cartesian convention, light travels left to right, the pole or optical centre is the origin, and positions follow ordinary coordinate rules. That is why a real object has negative u, a concave mirror has negative f, and a real image formed by a mirror, which lies in front of it, has negative v. Once the signs are right, the algebra tells you the nature of the image without drawing a ray diagram.

Lens and mirror formulas differ by a sign

For a mirror, light reflects back, so real images form on the same side as the object, in front of the mirror. The relation is 1/v + 1/u = 1/f and magnification is m = −v/u. For a lens, light passes through, so real images form on the far side, and the relation is 1/v − 1/u = 1/f with m = v/u. Both come from similar triangles in the ray diagram, under the paraxial assumption that rays make small angles with the principal axis.

Special positions and power

If an object sits exactly at the focus, 1/v becomes zero and the image forms at infinity, which the calculator reports. Inside the focus, a convex lens or concave mirror gives a virtual, erect, magnified image, which is how magnifying glasses and shaving mirrors work. Lens power P = 1/f in metres is measured in dioptres, and thin lenses in contact simply add their powers. An optometrist's prescription of −2.0 D means a concave lens of focal length −50 cm.

Worked example, step by step

Farhan holds his face 8 cm in front of a concave shaving mirror of focal length 12 cm, so u = −8 cm and f = −12 cm in the sign convention.

Mirror formula: 1/v = 1/f − 1/u = 1/-12 − 1/(-8) = 0.041667 v = 24 cm

Magnification: m = −v/u = −(24) ÷ -8 = 3

Nature of the image: Virtual, erect, magnified

Answer: Image distance v 24 cm; Magnification m 3

Common mistakes to avoid

Entering the object distance as positive for a real object in front of the lens or mirror.

Giving a concave mirror a positive focal length; in this convention it is negative.

Using the lens formula for a mirror, or m = v/u for a mirror instead of m = −v/u.

Reading negative v from a lens as real; for a lens, a negative v means a virtual image on the object's side.

Computing power with f in cm but using P = 1/f instead of P = 100/f.

Where it is used

Class 10 and Class 12 ray optics numericals and board exam practice.

JEE and NEET problems on image formation.

Understanding spectacle and contact lens prescriptions in dioptres.

Setting up projectors, cameras and magnifiers at the right distances.

Choosing concave or convex mirrors for vehicles, shops and shaving.

Frequently asked questions

Why is u negative?

Objects are placed in front of the lens or mirror, against the direction of incident light.

What is the power of a lens?

P = 1/f in metres, or 100/f in centimetres, measured in dioptres.