2,6-diaminopyridine is extensively used as a pharmaceutical intermediate and a hair dye coupler as oxidation formulations. It is soluble in protic solvents. Primary and secondary amines are N-methylated by various methods such as direct alkylation of amines with Hofmann mechanism, but in many of these methods due to overalkylations, we earn a mixture of amino products. Consequently, they aren't selective in secondary amines preparation. Also, the selective synthesis of secondary amines is a problematic field in organic chemistry. 2,6-diaminopyridine can be selective N-methylated from reaction of this compound with sodium azide and orthoformic ester in low time with good yields.