The present paper focuses on the Lagrange optimization of shock waves for a two-dimensional hypersonic inlet by limiting the cowl internal angle and inlet length. The results indicate the significant influences of geometric constraints on the configuration of shock waves and performances of an inlet. Specifically, the cowl internal angle mainly affects the internal compression section; the inlet length affects both the internal and external compression sections where the intensity of internal and external compression shock waves shows a deviation of equal. In addition, the performances of optimized inlets at off-design points are further numerically simulated. A prominent discovery is that a longer inlet favors a higher total pressure recovery at the positive AOA; conversely, a shorter inlet can increase the total pressure recovery at the negative AOA.