A method for obtaining a 5-bromolevulinic acid methyl ester or a 5-chlorolevulinic acid methyl ester from either a bromination mixture or a chlorination mixture, containing either a 5-bromo-levulinic acid methyl ester or a 5-chlorolevulinic acid methyl ester, respectively, produced by either brominating or chlorinating levulinic acid or a levulinic acid methyl ester, and further including the steps of dissolving the bromination or chlorination mixture in an organic solvent or solvent mixture and cooling the solution, preferably to −20° C.–−40° C., with the 5-bromolevulinic acid methyl ester or 5-chlorolaevulinic acid methyl ester being crystallized out of the solution. The 5-bromolevulinic acid methyl ester or 5-chlorolevulinic acid is then isolated by draining off the solution with the remaining bromination mixture or chlorination mixture, as appropriate.