# Lens and mirror calculator > Where does a lens or mirror form the image? Image distance, size and kind from the thin lens and mirror equation, drawn as a ray diagram. Find where a converging or diverging lens, or a concave or convex mirror, forms the image, how big it is and whether it is real, with a live ray diagram. - Page: https://how.box/lenses/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/lenses/?e={e}&f={f}&d={d}&h={h}&u={u} - `e` (converging, diverging, concave or convex): converging, diverging, concave or convex. Example: `converging`. - `f` (number 0.01 to 100000): Focal length (a positive size) in u. Example: `10`. - `d` (number 0.01 to 100000): Object distance in u. Example: `30`. - `h` (number 0.01 to 100000): Object height in u. Example: `2`. - `u` (mm, cm, m or in): mm, cm, m or in. Example: `cm`. Example answer: https://how.box/lenses/?e=converging&f=10&d=30&h=2&u=cm A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `lenses_calculate`: Thin lens and spherical mirror equation 1/f = 1/do + 1/di with magnification m = −di/do ("real is positive"). - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"lenses_calculate","arguments":{"element":"converging","focal_length":10,"object_distance":30,"object_height":2,"length_unit":"cm"}}}` - GET: https://how.box/mcp/run/lenses_calculate?element=converging&focal_length=10&object_distance=30&object_height=2&length_unit=cm ## How it works A lens bends light and a curved mirror reflects it so that rays from one point of an object meet again, or seem to come from one point: the image. A converging lens or concave mirror can gather the rays into a real image that you can catch on a screen; a diverging lens or convex mirror spreads them, so you only see a smaller, upright virtual image when you look through or into it. The thin lens equation, which also holds for spherical mirrors, is 1/f = 1/dₒ + 1/dᵢ, with f the focal length, dₒ the object distance and dᵢ the image distance. The magnification is m = −dᵢ/dₒ; a negative m means the image is upside down. With f = 10 cm and the object at 30 cm: 1/dᵢ = 1/10 − 1/30 = 1/15, so the image is 15 cm behind the lens, half the size and inverted. This uses the common "real is positive" convention from OpenStax University Physics, volume 3, chapter 2: a converging lens and a concave mirror have positive f, a real image has positive dᵢ. The ray diagram draws the three principal rays: one parallel to the axis that leaves through the focal point, one straight through the centre, and one through the near focal point that leaves parallel. Thick lenses and wide-angle rays deviate from this ideal. ## FAQ **Why is there no image when the object is at the focal point?** The lens or mirror then sends every ray out parallel, so they never meet. A magnifying glass held one focal length from a page makes the image infinitely far away, which your eye sees comfortably. **How does a magnifying glass work?** Hold a converging lens closer to the object than its focal length. It forms a virtual, upright image farther away and larger; with f = 10 cm and the object at 5 cm the image is twice the size. **Why do car side mirrors say objects are closer than they appear?** They are convex mirrors, which always form a smaller virtual image. Things look smaller and so farther away, but the mirror shows a wider view. **Can I calculate two lenses placed one after the other?** Not in a single calculation. The tool models one element, and the image from the first lens becomes the object for the second, with distances and signs worked out for that arrangement. **Should I enter a negative focal length for a diverging lens?** No. Enter the positive size of the focal length and choose the element type. The calculator applies the appropriate sign for a diverging lens or convex mirror. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)