Ray Diagram Generator Ray Diagrams
Describe a lens or mirror setup and get a clean, labeled ray diagram in seconds, with the principal axis, focal points, object and image arrows, and all three principal rays drawn. Converging and diverging lenses, concave and convex mirrors, and more.
Ray Diagram Generator
Your ray diagram will appear here
Describe your optics setup and click Generate
Ray Diagram Examples
Browse ray diagrams made with Figviz, or generate your own above
Converging Lens, Object Beyond 2F
A convex lens ray diagram with the object beyond 2F, showing a real, inverted, diminished image between F and 2F on the far side.
Diverging Lens, Virtual Upright Image
A concave lens ray diagram showing how all three principal rays diverge and appear to originate from a virtual, upright, diminished image.
Concave Mirror, Real Inverted Image
A concave (converging) mirror ray diagram with the object beyond F, showing three principal rays converging to form a real, inverted image.
Convex Mirror, Virtual Upright Image
A convex (diverging) mirror ray diagram where reflected rays diverge and the virtual image appears behind the mirror surface.
Plane Mirror, Reflection Ray Diagram
A plane mirror ray diagram showing the law of reflection, with the virtual image located the same distance behind the mirror as the object is in front.
Refraction Through a Glass Block
A refraction diagram showing a ray bending toward the normal as it enters a denser glass block and bending away as it exits, with angles labeled.
What is a ray diagram?
A ray diagram (also called an optical diagram or light ray diagram) is a scaled drawing that shows how light rays travel through a lens or reflect off a mirror to form an image. The diagram uses a horizontal principal axis, a symbol for the lens or mirror at the centre, labeled focal points, and a set of standard rays that follow predictable paths. Where the rays converge, or where they appear to diverge from, tells you the position, size, and nature (real or virtual, upright or inverted) of the image. Figviz draws the complete labeled diagram from a plain description of your setup, so you get the geometry right without drawing by hand.
How to draw a ray diagram
Lenses vs mirrors
Lenses refract light, so they have two focal points, one on each side. A converging (convex) lens bends parallel rays inward to a real focal point on the far side, while a diverging (concave) lens bends them outward and the focal point is virtual, on the same side as the incoming light. Mirrors reflect light, so both focal points are in front of the mirror surface. A concave (converging) mirror reflects parallel rays inward to a real focal point, while a convex (diverging) mirror reflects them outward with a virtual focal point behind the surface. The principal ray rules differ slightly between the two, but the logic for locating the image is the same.
Real vs virtual images
A real image forms where refracted or reflected rays actually meet in front of the lens or mirror. It can be projected onto a screen and is always inverted. A virtual image forms where rays only appear to meet when extended backward with dashed lines, it cannot be projected and is always upright. Converging lenses produce real images when the object is beyond the focal point, and virtual images when the object is inside F. Diverging lenses and convex mirrors always produce virtual images. Plane mirrors always produce virtual images the same size as the object.
Tips for accurate optics diagrams
Always specify the object position relative to F or 2F, that single detail determines everything about the image. State the lens or mirror type clearly (converging/diverging, concave/convex). If you need specific measurements or magnification labels, include them in your prompt. For refraction diagrams through prisms or glass blocks, mention the incoming angle and the shape of the medium. Regenerate with "minimal style" for cleaner print versions, or "colorful" to color-code each principal ray for teaching.
Frequently asked questions
Related physics & science tools
All tools →Make your own ray diagram with Figviz
Create a free account and get starter credits to generate your own. No credit card required.