A straight-through labyrinth seal is one of the most popular non-contacting annular seals through which energy dissipation by turbulence viscosity interaction is achieved with a series of teeth and cavities. The geometric parameters of the straight-through labyrinth seal, such as clearance, tooth width, tooth height, cavity width, and tooth inclination angle, affect its performance. The space for installing a labyrinth seal in turbomachinery is limited, and so it is important to optimize its geometry for a fixed axial length in order to minimize the leakage flow rate and the discharge coefficient. The objective of the current study is to understand the effects of changing the geometric parameters of the seal on the leakage flow rate and the discharge coefficient, and to determine the optimized geometry for a fixed axial length. When the whole axial length is fixed, the most effective way to decrease the discharge coefficient is to reduce the cavity width by increasing the number of cavities. However, if the number of cavities is too high, the beneficial effect of more cavities can be reversed. The results of this study will help turbomachinery manufacturers to design a more efficient labyrinth seal. Numerical simulations of leakage flow for the straight-through labyrinth seal were carried out using Reynolds-Averaged Navier–Stokes (RANS) models, and the results for their discharge coefficients and pressure distributions were compared to previously published experimental data.