Let Omega subset of R-n, n >= 2, be a bounded domain satisfying the separation property. We show that the following conditions are equivalent: (i) Omega is a John domain; (ii) for a fixed p is an element of (1, infinity), the Korn inequality holds for each u is an element of W-1,W-p (Omega, R-n) satisfying integral(Omega) partial derivative u(i)/partial derivative x(j) - partial derivative u(j)/partial derivative x(i) dx = 0, 1 <= i, j <= n, parallel to Du parallel to (Lp(Omega)) <= C-K (Omega, p) parallel to is an element of(u) parallel to (Lp(Omega)); (Kp) (ii') for all p is an element of (1, infinity), (K-p) holds on Omega; (iii) for a fixed p is an element of (1, infinity), for each f is an element of L-p (Omega) with vanishing mean value on Omega, there exists a solution v is an element of W-0(1,p) (Omega, R-n) to the equation div v = f with parallel to v parallel to (W1,p(Omega, Rn)) <= C (Omega, p) parallel to f parallel to (Lp(Omega)); (DEp) (iii') for all p is an element of (1,infinity), (DEp) holds on Omega. For domains satisfying the separation property, in particular, for finitely connected domains in the plane, our result provides a geometric characterization of the Korn inequality, and gives positive answers to a question raised by Costabel and Dauge (Arch Ration Mech Anal 217(3): 873-898, 2015) and a question raised by Russ (Vietnam J Math 41: 369-381, 2013). For the plane, our result is best possible in the sense that, there exist infinitely connected domains which are not John but support Korn's inequality.