Anemia is the most common blood disorder, affecting an estimated 2 billion people who lack enough healthy red blood cells or hemoglobin. It’s usually diagnosed by blood tests, but a new smartphone app can provide a diagnosis just from a photo of people’s fingernails, according to a new paper in Nature Communications.

How does it work? The algorithm, created by Wilbur Lam and colleagues at Emory University, detects anemia by assessing the concentration of hemoglobin from the color of people’s fingernail beds, using photos taken on a smartphone. Fingernail color is a good indicator of overall hemoglobin levels because our nails don’t contain any melanin-producing skin cells that would mask the color.

Testing: The four-week study involved 337 people with a range of blood conditions, including 72 healthy control subjects. The researchers report that the app outperformed physicians assessing hemoglobin levels from a physical exam—although it’s not as good as a blood test. But it is as good as, or even better than, a number of FDA-approved diagnostic tools on the market today, the paper claims. You can see it in action here.

The implications: Diagnosis by smartphone comes with some obvious benefits. It’s much more accessible and cheaper than seeing a doctor. It could be especially useful in remote areas lacking easy access to medical facilities. Patients with an existing diagnosis could also use the app to monitor their condition.

Diagnosis by algorithm: We’re only going to see these sorts of smartphone apps become more ubiquitous, fueled by the rise of AI in health care. The devices in our pockets are already being used to diagnose all sorts of conditions, including depression, HIV, and nearsightedness.