Objective To investigate the role of 20 allergens (cobalt chloride, etc.) in the disease process of dermatitis and eczema, and to evaluate the value of testing these allergens in the diagnosis and treatment. Methods A total of 248 patients with dermatitis or eczema who were treated in Guangzhou Institute of Dermatology from 2016 to 2020 and had basically complete clinical diagnosis and treatment data were selected as the analysis objects. Among them, there were 144 patients with dermatitis, including 17 males and 127 females who were 4-75 years old, and 95 patients with eczema, including 27 males and 68 females who were 2-78 years old. The 72 h observation results of 20 kinds of allergen patch tests, such as cobalt chloride, hydrophobic compounds, imidazolyl urea, p-phenylenediamine, N-cyclohexyl thiophthalide lactone, and Quartet 15, were retrospectively analyzed. χ2 test was applied. Results The allergen positive rates of nickel sulfate, cobalt chloride, and aromatic mixture I were the top three, and were 29.17% (42/144), 19.44% (28/144), and 9.72% (14/144) in the 144 patients with dermatitis and were 21.05% (20/95), 16.84% (16/95), and 11.58% (11/95) in the 95 patients with eczema, respectively. In the patients with dermatitis, the ratio of male to female was 1.00∶7.47, and the positive rates of all allergens were 47.06% (8/17) and 66.93% (85/127), respectively; the ratio of adolescents to young adults to middle-aged adults to the elderly was 1.00∶23.00∶3.80∶1.00, and the positive rates of all allergens were 20.00% (1/5), 66.09% (76/115), 57.89% (11/19), and 100.00% (5/5), respectively, with a statistical difference (χ2=9.02, P<0.05); the positive rates of one, two, and three or more kinds of allergens were 29.17% (42/144), 19.44% (28/144), and 15.97%(23/144), respectively, with a statistical difference (χ2=7.98, P<0.05). In the patients with eczema, the ratio of male to female was 1.00:2.52, and the positive rates of all allergens were 51.85%(14/27) and 64.71%(44/68) respectively; the ratio of adolescents to young adults to middle-aged adults to the elderly was 1.00:14.25:5.75:2.75, and the positive rates of all allergens were 25.00% (1/4), 63.16%(36/57), 52.17% (12/23), and 81.82% (9/11), respectively; the positive rates of one, two, and three or more kinds of allergens were 36.84% (35/95), 8.42% (8/95), and 15.79% (15/95), respectively, with a statistical difference (χ2=25.50, P<0.05). Conclusions Nickel sulfate, cobalt chloride, and aromatic mixture I are the high-risk causes of dermatitis and eczema. However, for all allergens, there are different characteristics of variability between allergen positive detection rates in different gender, age, and quantities, so the application of patch test for allergens is helpful for diagnosis and differential diagnosis.