Interleukin (IL)-17A plays important roles in hepatitis B virus (HBV)-induced liver diseases. This study aims to investigate IL17A single nucleotide polymorphisms (SNPs) and the predispositions to chronic HBV infection and hepatocellular carcinoma (HCC) risk and the correlations to IL-17A and IgE levels. Three hundred ninety-five chronic HBV patients, 75 HBV infection resolvers, and 174 healthy controls were included. IL17A SNPs rs8193036 (C/T) and rs2275913 (A/G) and serum IL-17A and IgE levels were determined. HBV infection resolvers had higher rs8193036 allele T and allele T-containing genotypes than HBV patients or controls. Compared with chronic hepatitis, HCC patients had more frequent rs2275913 genotype GG (odds ratios [OR] 3.317, 95% confidence interval [CI] 1.663–6.617, P = 0.001) and allele G (OR 1.844, 95% CI 1.311–2.595, P < 0.001), and more frequent haplotypes CG (OR 1.868, 95% CI 1.256–2.778, P = 0.002) and TG (OR 1.788, 95% CI 1.031–3.101, P = 0.037) of rs8193036 and rs2275913. Comparison of HCC patients with cirrhosis yielded similar findings. Apart from male gender and older ages, IL-17A level (OR 1.020, 95% CI 1.003–1.036, P = 0.019) and rs2275913 genotypes AG and GG (OR 1.704, 95% CI 1.214–2.390, P = 0.006) were factors significantly associated with HCC risk in multivariate analysis in comparison with HBV patients without HCC. These factors remained significant in multivariate analysis in relation to cirrhosis. IL17A rs2275913 genotype GG was associated with significantly increased IL-17A and IgE levels. IL17A polymorphisms may influence HCC risk in chronic HBV infection via regulating IL-17A production.