A convex lens gathers light to a focus; a concave lens spreads it out. Drag the sliders below to switch the lens type and change the focal length, object distance and object height, watching real and virtual images form via 1/v = 1/f + 1/u.
Trace the three principal rays through a thin lens and watch where they cross to form the image: 1/v = 1/f + 1/u. A convex lens can make real or virtual images depending on where the object sits; a concave lens always makes a small, upright, virtual one.
Each button picks the lens type and sets all three sliders to a recognisable piece of optics, then lets the simulator trace the rays. The confirmation line quotes the lab's own readouts, not a stored answer.
Pick a setup above, or drag the sliders yourself.

The concave vs convex lens simulator is a free interactive physics lab that runs in your browser — nothing to install and no sign-up. Change lens type, focal length and object distance and watch real and virtual images form. It reports Image nature, Image distance, Magnification and Image height h' · power as you drag the sliders.
| Control | Range | Step |
|---|---|---|
| Focal length magnitude | 5 – 40 cm | 1 |
| Object distance | 5 – 60 cm | 1 |
| Object height | 1 – 8 cm | 0.5 |
P = 1/f, which is how a real prescription is written — 15 cm is +6.67 D, 40 cm is +2.50 D.u = f and the image flips from real and inverted to virtual and upright. On a concave lens nothing qualitative happens, which is itself the point.
Keep the lens convex with f = 15 cm and the object 4.0 cm tall, then move only the object-distance slider. Every figure below is the string the simulator itself printed at that position, read back out of the running lab rather than worked out on paper.
| Step | Object distance | Image distance | Magnification | Image height | Image nature |
|---|---|---|---|---|---|
| Start (Reset) | 40 cm | 24 cm | -0.60 | -2.40 cm | real · inverted · diminished |
| Bring it in to 2f | 30 cm | 30 cm | -1.00 | -4.00 cm | real · inverted · same size |
| Closer still, just outside f | 20 cm | 60 cm | -3.00 | -12.00 cm | real · inverted · magnified |
| Right on the focal point | 15 cm | infinity | infinity | infinity | image at infinity (rays emerge parallel) |
| Inside the focal length | 8 cm | -17.1 cm | +2.14 | +8.57 cm | virtual · upright · magnified |
| Same lens, made concave | 40 cm | -10.9 cm | +0.27 | +1.09 cm | virtual · upright · diminished |
The sequence is the whole of thin-lens optics in five moves. Rows 1 to 3: as the object comes in from 40 cm to 20 cm the image runs the other way, from 24 cm out to 60 cm, and grows from 0.60 of the object to three times it. Object and image are trading places along the axis. Row 2 is the crossing point: at exactly twice the focal length the image lands at twice the focal length on the far side and the magnification is exactly -1.00, the same size upside down. Inside 2f the image is magnified; outside it, diminished. Row 4 is the boundary: put the object on the focal point and the rays leave parallel, so all three numeric readouts print the word infinity. Row 5 crosses it: one step further in and the image distance is negative — the light no longer converges at all, and the eye sees a virtual, upright, 2.14× image where the rays only appear to originate. That is a magnifying glass, and it works only inside the focal length. Row 6 switches the lens type with nothing else touched: the concave lens turns the same 40 cm object into a virtual image 10.9 cm from the lens at 0.27 of the size.
Object height is the one slider that does not affect the geometry. Move Object height h from 1.0 cm to 8.0 cm at f = 15 cm and u = 30 cm and the lab still reports an image distance of 30 cm and a magnification of -1.00 — only h' changes, from -1.00 cm to -8.00 cm. Where the image forms and how much it is scaled are set by f and u alone; the object's size just rides along.
The lab solves 1/v = 1/f + 1/u and then m = v/u and h' = m·h. The ranges marked “in this lab” are the simulator's own displayed values at the ends of its control travel.
| Symbol | Meaning | SI unit | Typical range |
|---|---|---|---|
| f | Focal length — positive for the convex lens, negative for the concave one | metre, m | 5 to 40 cm in this lab, set as a magnitude by the slider and signed by the lens-type button. |
| u | Object distance from the lens | metre, m | 5 to 60 cm in this lab. |
| h | Object height | metre, m | 1.0 to 8.0 cm in this lab, in 0.5 cm steps. |
| v | Image distance. Positive means a real image on the far side, negative a virtual image on the object’s side | metre, m | the lab has printed values from +5.71 cm (convex, f = 5, u = 40) out to -1560 cm (convex, f = 40, u = 39), and the word “infinity” when u = f exactly. |
| m | Magnification. The sign is the orientation: negative is inverted, positive upright | dimensionless ratio | -0.14 to +40.00 across this lab’s range. |
| h' | Image height, h' = m·h | metre, m | +0.31 cm at the diverging extreme up to +160.00 cm at the converging one. |
| P | Lens power, P = 1/f with f in metres | dioptre, D (m−1) | +20.00 D (convex, f = 5 cm) down to +2.50 D (convex, f = 40 cm), and -2.50 D to -20.00 D for the same concave focal lengths. |
| Image nature | The three-part verdict the lab prints: real or virtual, inverted or upright, magnified, diminished or same size | not a unit | a convex lens produces all of them; a concave lens prints “virtual · upright · diminished” at every setting the lab allows. |
Your two lenses do opposite things to the same rays. A convex lens is converging: it pulls incoming light toward a single focus. A concave lens is diverging: it fans the same light outward. That one difference decides every image you can form. Flip the lens-type toggle and watch the traced rays swing from meeting to splaying apart while the readouts recompute the outcome.
The simulation solves the thin-lens equation in the form it displays, 1/v = 1/f + 1/u, giving the image distance v and the magnification m = v/u. Convex lenses carry a positive f; concave lenses a negative one. Drag Object distance across a convex lens and the image jumps between two lives: a far object yields a real, inverted image that could land on a screen, while an object tucked inside the focal length yields a virtual, upright, magnified one — the magnifying glass in your hand.
A concave lens refuses that drama. Slide the object anywhere and it stays virtual, upright, and diminished, its rays only appearing to diverge from a point you cannot project. Real images meet; virtual ones merely seem to. Only the converging lens can enlarge; the diverging one always shrinks — confirm each rule by reading m as you go. Push the same numbers through the lens and mirror calculator, then open more optics playgrounds.
A convex lens is converging: it is thicker in the middle and bends parallel light to a focus. A concave lens is diverging: it is thinner in the middle and spreads light outward. A convex lens has a positive focal length, a concave lens a negative one.
It depends on the object distance. An object beyond the focal length gives a real, inverted image that can be projected on a screen. An object inside the focal length gives a virtual, upright, magnified image — the magnifying-glass effect.
Always a virtual, upright, diminished image, at any object distance. A diverging lens cannot form a real image of an ordinary object, so it always makes the object look smaller.
A real image forms where light rays actually meet, so it can be caught on a screen and is inverted. A virtual image forms where rays only appear to come from, so it cannot be projected and is upright.
The rays leave the lens parallel and never meet, so there is no image at any finite distance. Set f = 15 cm and u = 15 cm in the simulator and all three readouts change to the word infinity, with the nature line reading "image at infinity (rays emerge parallel)". This is the boundary between the real-image and virtual-image behaviour of a convex lens.
At exactly twice the focal length. With f = 15 cm, setting the object distance to 30 cm makes the simulator report an image distance of 30 cm and a magnification of -1.00, described as real, inverted, same size. Object and image sit symmetrically either side of the lens, which is how a 1:1 copying setup is arranged.
Power is simply the reciprocal of the focal length in metres, so a 15 cm convex lens reads +6.67 D in the simulator and a 40 cm concave lens reads -2.50 D. Dioptres are used because thin lenses in contact add their powers directly, which is far easier than combining focal lengths — and it is why spectacle prescriptions are written in dioptres rather than centimetres.
The sign carries the orientation, not the size. A negative magnification means the image is inverted, a positive one means it is upright. In the lab, m = -3.00 is an image three times the object's height and upside down, while m = +2.14 is a little over twice the height and the right way up.