The PD Journal
How Our PD Measurement Tool Works, Step by Step
Last updated: October 2026 | Reading time: 9 minutes
Short answer: the tool finds your face and irises in a photo, finds a bank card held on your forehead, uses the card's known width as a ruler, corrects for perspective and for the inward turn of your eyes, and reports your PD with an estimated error. Everything runs in your browser.
1. Find the face and eyes
The tool uses MediaPipe Face Mesh, an open-source face-landmark model from Google. It places hundreds of points on the face, including a centre and four edge points for each iris. The same family of models is described in MediaPipe Iris.
2. Refine each iris centre
Landmark models can drift by about a pixel. The tool takes a small crop around each eye and looks for the sharp brightness change between the dark iris and the white of the eye. It tests circles around the landmark and keeps the one that best follows that edge on the left and right sides of the iris, because the eyelids cover the top and bottom. If the edge is weak, it falls back to the original landmark.
3. Check the photo before measuring
It stops and asks you to retake if it sees:
- a head turn above about 6°, a tilt, or a chin up/down;
- closed or very narrow eyes, or glare on the pupils;
- eyes not looking at the lens (for distance PD);
- no card, a partly hidden card, or a card at an impossible angle.
See PD tool not working: fixes.
4. Find the card and set the scale
A standard bank card is 85.60 mm wide. The tool finds the card's edges, measures its width in pixels and derives millimetres per pixel.
5. Move the scale from the forehead to the eyes
Your forehead is closer to the camera than your pupils, so the card appears slightly bigger than a card at eye depth would. The tool uses a simple camera model to estimate the distance to the card, adds an assumed depth between forehead and pupils, and rescales so the millimetres-per-pixel match the pupil plane.
6. Correct for head turn and eye convergence
- Head turn: a small remaining turn shrinks the horizontal gap in the image by about cos θ. The tool divides it back out.
- Convergence: when you look at a camera 40 cm away, your eyes turn inward and the pupils end up roughly 1.5 mm closer together than when you look into the distance. For distance PD, the tool adds this back.
7. Cross-check with the iris
The human iris is close to 11.7 mm across, with variation of about half a millimetre. The tool uses it as a second, rougher ruler. If it disagrees with the card by more than a few percent, the tool warns you.
8. Report the result with an error estimate
You get a binocular PD, a left and right value measured from the centre of your nose bridge (they always add up), and an estimated error in millimetres. Taking several photos lets the tool discard outliers and average the rest.
What it does not do
- It does not replace an optician for progressive lenses, strong prescriptions or children.
- It has not yet been validated against an optician's pupillometer on a large group of real people, so we do not publish an accuracy percentage.
- It does not measure fitting height or other fitting values.
Privacy
Your photo is analysed in your browser. See is the PD tool private?.
Related
Measure PD with a credit card · What limits PD accuracy · Try the tool