The term ‘hand dermatitis’ describes inflammatory skin condition localized to the hands. Nurses working at hospital settings are prone to develop hand dermatitis. The current study aimed to evaluate whether certain genetic polymorphisms were associated with the development of atopic eczema or non-atopic hand dermatitis in Taiwanese population. Nurses of Kaohsiung Medical University Hospital were recruited. Atopic eczema, non-atopic hand dermatitis and normal control groups were identified. The serine protease inhibitor Kazal type 5 (SPINK5), filaggrin and interleukin-31 (IL-31) gene variants were compared between the diseased and control groups. Our results showed that rs2303070 T allele of SPINK5 (assuming recessive model; OR = 3.58, 95% CI 1.63–7.84; P = 0.0014) and rs7977932 G allele of IL-31 (assuming recessive model; OR = 18.25, 95% CI = 3.27–101.94; P = 0.0009) were associated with increased risks of developing atopic eczema, while rs6892205 G allele of SPINK5 (assuming dominant model; OR = 3.79, 95% CI 1.55–9.28; P = 0.0036) was associated with the development of non-atopic hand dermatitis. In summary, our results showed that distinct SPINK5 and IL-31 gene variants were associated with the development of atopic eczema and non-atopic hand dermatitis. The barrier function, particularly those regulated by SPINK5, may play an important role in the development of both atopic eczema and non-atopic hand dermatitis.