The process in which a relatively unspecialized myeloid precursor cell acquires the specialized features of a mast cell. A mast cell is a cell that is found in almost all tissues containing numerous basophilic granules and capable of releasing large amounts of histamine and heparin upon activation.