We obtain several formulas for the Euclidean distance degree (ED degree) of an arbitrary nonsingular variety in projective space: in terms of Chern and Segre classes, Milnor classes, Chern-Schwartz-MacPherson classes, and an extremely simple formula equating the Euclidean distance degree of X with the Euler characteristic of an open subset of X.