The variable stiffness of robot joints plays an important role in improving the robot’s compliance, safety, and energy efficiency. In this paper, a novel type of variable stiffness joint based on a rack and pinion structure (VSJ-RP) is proposed. The structure and the variable stiffness principle of the joint are described in detail. The theoretical stiffness calculation and the dynamic model of the joint are established, and the correctness of the model is validated by simulation. The compliance, safety, energy storage, and release characteristics of the joint are validated by position, bearing capacity, hitting ball, and safety detection experiments, respectively. These experimental results show that the joint stiffness can be adjusted from 14.74 Nm/rad to 726.58 Nm/rad, and the overshoot of the position response is about 5.56–0.5%. The larger the stiffness of the joint, the faster the adjustment response, the smaller the fluctuation, and the more stable the operation are. The maximum output torque of the joint is about 20 Nm, and the torque difference between the minimum and the maximum stiffness of the joint is about 10%. The energy conversion efficiency of the joint is 17.56%~89.86%, and the deformation angle range is 2.66°~4.37°. These phenomena reflect the safety, energy storage, and release capacity of the joint. An effective exploration is performed regarding the miniaturization, safety, and energy utilization of robot variable stiffness joints.