In insects, anatomical features of the head have been found to provide important information for phylogenetic and comparative evolutionary studies. We analyzed the internal head morphology of three (omaliine, tachyporine, oxyteline group) out of the four subfamily groups of the beetle family Staphylinidae plus two non-staphylinid outgroups (i.e., Agyrtidae and Leiodidae). Synchrotron X-ray micro-tomography was used to obtain comparative head anatomical datasets of eight species to describe (i) the presence/absence of muscles inside the head capsule and (ii) the variability in their points of origin. Nineteen of these muscles were phylogenetically informative (nine with respect to presence/absence and eleven with respect to the origin; one muscle had an influence on both analyses) and were used in character mapping analyses to reconstruct groundplan patterns of the head musculature in Staphylinidae and their subgroups. Three muscles (Mm. 7, 9, 50) were identified as possibly autapomorphic for Staphyliniformia. The taxon (Agyrtidae + Leiodidae) is supported by the absence of M. 9. The monophyly of the tachyporine group is supported by a common origin of M. 4. Aleocharinae, a subfamily within the tachyporine group, is supported by the absence of M. 42 and possibly by numerous points of origin of various muscles (Mm. 1, 17, 28, 29, 30). Our analysis of the general organization of the hypopharynx-prementum-complex has revealed that this complex is organized in a similar way in the investigated staphylinoids, i.e., with the prementum lying anteriorly to and being in line with the hypopharynx and the mentum. We have found deviating conditions in the investigated species of the Aleocharinae, in which the prementum can be largely retracted posteriorly. Consequently, it is sandwiched between the ventral mentum and the dorsal hypopharyngeal region. The hypopharyngeal region is thus lifted dorsad to a large extent, approaching the cibarial roof. This situation is paralleled by a loss of the hypopharyngeal retractor (M. 42) and a shift of origin of premental retractors (Mm. 28-30) posteriorly toward the gula.