Nevus spilus (NS) is composed of multiple types that characterized by a congenital hyperpigmented patch within variable even superimposed lesions originating from melanocytic lineage cells. The molecular mechanism and classification of diverse NS phenotypes remain unclear. Five children with a phenotype of NS were genotyped by the panel based on next‐generation sequencing in this study. DNA from biopsies, blood samples and hair follicle were sequenced to confirm the presence of a somatic mutation. Sequencing results indicated somatic mutation in the gene of NRAS or HRAS in all biopsies from the nevi, and the pathogenic variants were not detected in the samples of blood and hair follicle. This study successfully identified the somatic mutation in five unrelated children with diverse NS phenotypes. Moreover, it provided typical images and differential diagnoses between variable NS phenotypes in clinical, pathological, and genetic features, and first proposed a clinical diagnostic algorithm that contributed to simplifying and optimizing the diagnoses and management of these overlapped diseases.