Variable stiffness can improve the capability of human–robot interacting. Based on the mechanism of a flexible rack and gear, a rotational joint actuator named vsaFGR is proposed to regulate the joint stiffness. The flexible gear rack can be regarded as a combination of a non-linear elastic element and a linear adjusting mechanism, providing benefits of compactness. The joint stiffness is in the range of 217–3527 N.m/rad, and it is inversely proportional to the 4th-order of the gear displacement, and nearly independent from the joint angular deflection, providing benefits of quick stiffness regulation in a short displacement of 20 mm. The gear displacement with respect to the flexible gear rack is perpendicular to the joint loading force, so the power required for stiffness regulating is as low as 14.4 W, providing benefits of energy saving. The working principles of vsaFGR are elaborated, followed by presentation on the mechanics model and the prototype. The high compactness, great stiffness range and low power cost of vsaFGR are proved by simulations and experiments.