Flexibility models based on the virtual joint approach (VJA) are essential for error compensation to improve the positioning accuracy of industrial robots across a range of payloads. However, current flexibility models are not accurate enough due to less consideration of deformation, or incorporate too many factors leading to difficulties in practical applications. This paper proposes a flexibility model based on the error sensitivity analysis to improve the positioning accuracy and stability of industrial robots. First, the effects of the six directions flexible deformation of the joint on the positioning error are analyzed by introducing the Sobol's method. It indicates that the rotational deformations around X, Y and Z-axes cause the majority of positioning errors, and only a tiny minority is originated from translational deformations along X, Y, and Z-axes. Then, a mapping equation between the flexible deformations around X , Y and Z-axes and the positioning error is derived based on this observation. Finally, a flexibility model for N degrees of freedom (DoF) industrial robots is established and an identification method is presented for flexibility coefficients. The verification experiments are performed on a 6-DoF robot, and an application example is provided for error compensation in robotic assembly tasks. The experimental results show that the proposed model has higher accuracy and stability but lower calculation cost than conventional models. Moreover, after compensation, the pose error is reduced to 0.1mm and 0.03 degrees meeting the assembly requirements in the application example. Note to Practitioners-The joint deformation under payload and link gravity is mainly responsible for the degraded positioning accuracy of industrial robots. Error compensation by flexibility models is an effective way to improve positioning accuracy. Traditional 6-DoF flexibility models are too complex to be used in industrial scenarios, while 1-DoF flexibility models are not accurate enough. This paper proposes an error sensitivity flexibility compensation that considers the main factors affecting the positioning error, while removing factors with less impact. Compared with traditional models, the proposed model combines both high accuracy and applicability. Through establishing the mathematical equation between the joint deformation and the positioning error, a new flexibility model is derived, and an easy-to-implement method is provided to identify flexibility coefficients. The proposed model can be used conveniently for high-precision compensation of errors, including applications with constant payloads, such as assembly, cutting and welding, as well as tasks with variable payloads, such as milling, drilling and de-burring. In addition, the model can also be used to optimize poses to reduce robot flexibility and enhance resistance to deformation in one workspace. Experiments indicate that high compensation accuracy can be obtained by applying the flexibility model to robot assembly tasks.