Using a quality by design approach, a capillary electrophoresis method for the simultaneous determination of dextromepromazine and the oxidation product levomepromazine sulfoxide in levomepromazine was developed. The analytical target profile was defined that the method should be able to quantify 0.1% of both impurities with a precision of ≤10%. Hydroxypropyl-γ-cyclodextrin was used as chiral selector. The critical process parameters cyclodextrin concentration, buffer pH and concentration as well as temperature and applied voltage were studied using a fractional factorial resolution V+ design for defining the knowledge space. A central composite face centered design was used as response surface methodology for deriving the design space by Monte Carlo simulations. The selected working point was a 100 mM citric acid buffer, pH 2.85, containing 3.6 mg/mL hydroxypropyl-γ-cyclodextrin, a temperature of 15 °C and a voltage of 25 kV. Robustness was estimated using a Plackett-Burman design. The method was subsequently validated in the relative concentration range of 0.1%–1.0% of the impurities for a solution containing 0.25 mg/mL levomepromazine. The method was applied to the determination of the purity of the reference substance of the European Pharmacopoeia and of the drug in a commercial injection solution.