To compare masticatory muscle thickness in patients with temporomandibular disorders (TMDs) during rest and clenching, and by body position, using ultrasonography. This prospective study included 96 patients with TMD (67 females, 29 males; mean age: 40.41 ± 17.88 years): group 1, comprising 66 patients with TMD without bruxism (TMD_nonbruxer), and group 2, comprising 30 patients with concurrent TMD and bruxism (TMD_bruxer). In patients with TMD, bruxism was correlated with the presence of tinnitus, muscle stiffness, sleep problems, psychological stress, and restricted mouth opening. The masseter muscle significantly thickened during clenching (11.16 ± 3.03 mm vs 14.04 ± 3.47 mm, p < 0.001), whereas the temporalis muscle showed no significant increase in thickness from resting to clenching in an upright position (7.91 ± 1.98 vs 8.39 ± 2.08, p = 0.103). Similarly, during clenching in the supine position, the masseter muscle was significantly thicker compared with rest (11.24 ± 2.42 vs 13.49 ± 3.09, p < 0.001), but no significant difference was observed in temporal muscle thickness (8.21 ± 2.16 vs 8.43 ± 1.94, p = 0.464). In comparison between two groups, the average thickness of the masseter muscle was greater among TMD_bruxers than among TMD_nonbruxers in both the upright and supine positions (all p < 0.05). In the generalized lineal model, female sex (B = − 1.018, 95% confidence interval [CI] − 1.855 to − 0.181, p = 0.017) and bruxism (B = 0.868, 95% CI 0.567 to 1.169, p = 0.048) significantly predicted changes in masseter muscle thickness. Female sex (B = − 0.201, 95% CI − 0.299 to − 0.103, p = 0.011), increased age (B = − 0.003, 95% CI − 0.005 to 0.000, p = 0.038), and muscle stiffness (B = − 1.373, 95% CI − 2.369 to − 0.376, p = 0.007) were linked to decreased temporal muscle thickness. Comparing TMD nonbruxer and bruxer muscle thicknesses in upright and supine positions revealed significant increased thickness in the masseter muscle during clenching but not in the temporalis muscle. Masseter muscle thickness varied significantly by sex, body position, and resting/clenching, notably influenced by bruxism. These findings emphasize the relevance of these factors in clinical examinations of patients with TMD.