Background: Prescribing insulin to patients with type 2 diabetes may present as a problem even for endocrinologists, since there are no objective criteria for calculating the starting dose of insulin and the dose is often selected empirically based on the subjective assessment of a particular specialist; for example, by the selection method in a hospital with permanent observation: Set dose is prescribed and the level of sugar is monitored during the day. This is not possible in an outpatient setting. Methods: Authors used a computer simulation method with 3D plotting to create a technology for calculating the required dose of insulin for patients with secondary insulin deficiency that developed with the background of type 2 diabetes. Results: Clinical and laboratory examination of more than 200 patients with type 2 diabetes was conducted; the most significant correlations of the studied parameters (age, BMI) with the prescribed doses of insulin were identified; a formula for the calculation of the required insulin dose was derived with the construction of a 3D graph. Conclusions: Obtained method allows to transfer patients with type 2 diabetes to insulin quickly and safely, which could be used both temporarily (for the period of surgery, illness, high levels of glycated hemoglobin) and as a part of combined or permanent insulin therapy. © The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2023.