A novel Liquid Chromatography-tandem mass spectrometry (LC–MS/MS) method is presented for the quantitative determination of two potential genotoxic impurities (PGIs) in rabeprazole active pharmaceutical ingredient (API). In order to overcome the analytical challenges in the trace analysis of PGIs, a development procedure supported by Quality-by-Design (QbD) principles was evaluated. The efficient separation between rabeprazole and the two PGIs in the shortest analysis time was set as the defined analytical target profile (ATP) and to this purpose utilization of a switching valve allowed the flow to be sent to waste when rabeprazole was eluted. The selected critical quality attributes (CQAs) were the separation criterion s between the critical peak pair and the capacity factor k of the last eluted compound. The effect of the following critical process parameters (CPPs) on the CQAs was studied: %ACN content, the pH and the concentration of the buffer salt in the mobile phase, as well as the stationary phase of the analytical column. D-Optimal design was implemented to set the plan of experiments with UV detector. In order to define the design space, Monte Carlo simulations with 5000 iterations were performed. Acceptance criteria were met for C8 column (50 × 4 mm, 5 μm), and the region having probability π ≥ 95% to achieve satisfactory values of all defined CQAs was computed. The working point was selected with the mobile phase consisting of ACN, ammonium formate 11 mM at a ratio 31/69 v/v with pH = 6,8 for the water phase. The LC protocol was transferred to LC–MS/MS and validated according to ICH guidelines.