Large-scale introduction of automated processes into medical practice, including ophthalmology, can simplify the diagnosis and treatment of patients. Being part of the general biological system of the body, the eye is an exemplary object of mathematical modeling targeted at treatment optimization, — e. g. when choosing a surgical tool for retinal detachment surgery.Purpose: to develop a software for automatic calculation of the individual length of the circular band to be used in retinal detachment treatment in order to achieve the optimal height of scleral indentation.Materials and methods. The study had a dual task: 1) to determine the correlation between the axial length (AL) and the equatorial diameter of the eyeball, measured by ultrasonic A- and B-scanning in healthy patients (90 eyes), and 2) to develop formulas for calculating the optimal length of the scleral buckle.Results. The formulas found to be effective in clinical practice were used to develop a software calculating the required length of the 3-mm wide circular band made of pourous silicon from the patient’s axial length. The software, called Circular Scleral Buckle Length, operates under Windows or Linux, is freely downloadable using a QR-code.Conclusion. The software greatly facilitates the determination of the optimal length of the buckling material for each patient, simplifies the operation of circular scleral buckling, reduces the time of the operation, minimizes the risk of complications, and ensures favorable anatomical and functional results.