Novel methods and systems for producing a substantially pure d-threo stereoisomer of methylphenidate or a salt thereof are provided. In particular, methods and systems for producing d-threo-methylphenidate hydrochloride in pure stereoisomeric form from d-threo-ritalinic acid hydrochloride using diazomethane are described. The described methods can be performed on a large scale, and thus provide d-threo methylphenidate or a salt thereof, and particularly the hydrochloride salt of d-threo-methylphenidate, in stereoisomerically pure form and in large quantities from a single batch reaction. Also described are novel compositions of d-threo methylphenidate hydrochloride.