It is the distance between the centers of your pupils, measured in millimeters.
It ensures that the optical center of each lens aligns correctly with your eyes. If PD is incorrect, glasses can cause eye strain, headaches, or blurred vision.
Although PD is usually measured during eye exams, it is often not included on prescriptions, making it hard to order glasses online without visiting an optician.
This app allows you to measure your own PD using a simple selfie.
- Place an ArUco marker just above and between your eyes, facing the camera and parallel to your face. This acts as a reference object with a known size, allowing the app to convert distances in pixels into real-world measurements accurately.
- Take a clear photo showing your eyes while looking directly at the camera (see example below).
- Upload the photo to the app. The backend automatically:
- Detects the center of each iris and computes the distance between them in pixels.
- Detects the ArUco marker and uses it as a scale reference to convert pixel distances into real-world measurements.
- Calculates and returns your Pupillary Distance (PD) in millimeters.
- The app will display the detected iris centers on the image and show your computed PD, allowing you to visually verify accuracy before using the measurement.
- It is recommended to run the app multiple times with different images and take the average result for more accurate PD measurement.
You can generate a marker here: ArUco Marker Generator.
- Check the Releases tab for a provided precompiled Windows executable.
- Note: An antivirus may trigger a false-positive warning.
Alternatively follow these steps to manually run or build this app.
pip install uv
uv venv --python 3.11 .venv
source .venv/Scripts/activateuv pip sync uv.lockuv pip install -e backend
# optionally generate a lock file
uv pip compile ./backend/pyproject.toml -o uv.lock This command will start the FastAPI backend and serve your frontend automatically. It also opens your default browser to the app interface.
python run.pyTo create a standalone binary executable:
uv pip install pyinstaller
pyinstaller --onefile --add-data "frontend;frontend" --collect-data mediapipe run.pyThis app is provided for personal use only.
Use it at your own responsibility. We provide no guarantees, warranties, or medical advice.

