This invention mainly relates to a process for the purification of rivaroxaban and its pharmaceutically accepted salts, wherein the crude rivaroxaban treated with an acid optionally, in presence of solvent to form clear solution which further precipitates out the pure rivaroxaban or its pharmaceutically accepted salt by adding anti-solvent. The obtained rivaroxaban having the desired purity with quality by avoiding any further purification