A closing wedge osteotomy of the lumbar spine may be considered to correct posture and spinal balance in progressive thoracolumbar kyphotic deformity caused by ankylosing spondylitis (AS). Adequate deformity planning is essential for reliable prediction of the effect of surgical correction of the spine on the sagittal balance and horizontal gaze of the patient. The effect of a spinal osteotomy on the horizontal gaze is equal to the osteotomy angle. However, the effect of a spinal osteotomy on the sagittal balance depends on both the correction angle and the level of osteotomy simultaneously. The relation between the correction angle, the level of osteotomy and the sagittal balance of the spine can be expressed by a mathematical equation. However, this mathematical equation is not easily used in daily practice. We present the computer program ASKyphoplan that analyses and visualizes the planning procedure for sagittal plane corrective osteotomies of the spine in AS. The relationship between the planned correction angle, level of osteotomy and sagittal balance are coupled into the program. The steps taken during an ASKyphoplan run are outlined, and the clinical application is discussed. The application of the program is illustrated by the analysis of the data from a patient recently treated by a lumbar osteotomy in AS. The software can be used free of charge on the internet at http://www.stega.nl under the heading "research" in the menu.