Aims. We calculate Keplerian (mass shedding) configurations of rigidly rotating neutron stars and strange stars with crusts. We check the validity of the empirical formula for Keplerian frequency, f(K), proposed by Lattimer & Prakash, f(K)(M) = C (M/M-circle dot)(1/2)(R/10 km)(-3/2), where M is the (gravitational) mass of the Keplerian configuration, R is the (circumferential) radius of the non-rotating configuration of the same gravitational mass, and C = 1.04 kHz. Methods. Numerical calculations are performed using precise 2D codes based on the multi-domain spectral methods. We use a representative set of equations of state (EOSs) of neutron stars and quark stars. Results. We show that the empirical formula for fK(M) holds within a few percent for neutron stars with realistic EOSs, provided 0.5 M-circle dot < M < 0.9 M-max(stat), where M-max(stat) is the maximum allowable mass of non-rotating neutron stars for an EOS, and C = C-NS = 1.08 kHz. Similar precision is obtained for strange stars with 0.5 M-circle dot < M < 0.9 M-max(stat). For maximal crust masses we obtain C-SS = 1.15 kHz, and the value of C-SS is not very sensitive to the crust mass. All our Cs are significantly larger than the analytic value from the relativistic Roche model, C-Roche = 1.00 kHz. For 0.5 M-circle dot < M < 0.9 M-max(stat), the equatorial radius of the Keplerian configuration of mass M, R-K(M), is, to a very good approximation, proportional to the radius of the non-rotating star of the same mass, R-K(M) = a R(M), with a(NS) approximate to a(SS) approximate to 1.44. The value of a(SS) is very weakly dependent on the mass of the crust of the strange star. Both a values are smaller than the analytic value a(Roche) = 1.5 from the relativistic Roche model.