The dendritic morphology of neurons determines the number and type of inputs they receive. In the Drosophila peripheral nervous system (PNS), the external sensory (ES) neurons have a single nonbranched dendrite, whereas the lineally related multidendritic (MD) neurons have extensively branched dendritic arbors. We report that hamlet is a binary genetic switch between these contrasting morphological types. In hamlet mutants, ES neurons are converted to an MD fate, whereas ectopic hamlet expression in MD precursors results in transformation of MD neurons into ES neurons. Moreover, hamlet expression induced in MD neurons undergoing dendrite outgrowth drastically reduces arbor branching.