If you’ve ever tried to use augmented reality tools built with Apple’s ARKit or Google’s ARCore to measure real-world objects, you know that you’ll be lucky to get within an inch of their actual sizes — estimates that are of no practical value when measuring, say, shoe sizes for feet. So when Nike (via CNBC) says it has developed technology that will let its eponymous app achieve sub-2-millimeter accuracy in fitting shoes, that’s a big step forward.

This July, Nike plans to add Nike Fit technology to its iPhone app and some retail stores, using multiple tricks to properly measure any user’s foot. Using a series of photographs, combined with AI and machine learning software, the technology begins by capturing an image of the floor next to a wall and then uses AR to generate a virtual “stand here” dot so you can snap an image of your feet while standing against the wall. Thirteen data points are then used to determine the length and width of each foot, resulting in a shoe size recommendation.

The word “determine” is more appropriate than “estimate” in this case, because the measurements are — thanks to machine training — accurate to within roughly a millimeter of actual size. That’s more than enough to properly fit a shoe to your needs, and it hints at a future in which other AR developers’ apps will be able to achieve similar measurement precision, at least when presented with solid reference points and after having been properly trained on examples.

So is shoe-sizing really that big a problem? Nike points to research showing that a staggering three out of five people are wearing the wrong shoe size and also cites the high costs of returning merchandise to retailers. While Nike+ customers can typically return shoes for free, retailers eat shipping and restocking expenses, which indirectly drives prices up.

Having previously used AR in promotions and to show off new styles in its SNKRS app, Nike is first adding Nike Fit to the standard Nike app and some of its U.S. retail stores; sales associates will handle the scanning for customers in stores. European locations will get the feature later this summer. It’s unclear if and when Android device users will get access to the technology.

Updated at 8:13 a.m. Pacific: A Nike spokesperson now says that the Android version of the Nike app is expected to be updated alongside the iPhone version in July.