Nonalcoholic fatty liver disease (NAFLD) is the most common chronic liver disease with multifactorial pathogenesis; histone demethylases (HDMs) are emerging as attractive targets. We identified HDM genes (including KDM5C, KDM6B, KDM8, KDM4A, and JMJD7) that were differentially expressed in NAFLD and normal samples by exploring gene expression profiling datasets. There was no significant difference in the expression of genes related to histone demethylation between mild and advanced NAFLD. In vitro and in vivo studies indicated that KDM6B and JMJD7 were upregulated at the mRNA level in NAFLD. We explored the expression levels and prognostic values of the identified HDM genes in hepatocellular carcinoma (HCC). KDM5C and KDM4A were upregulated in HCC compared to normal tissue, while KDM8 showed downregulation. The abnormal expression levels of these HDMs could provide prognostic values. Furthermore, KDM5C and KDM4A were associated with immune cell infiltration in HCC. HDMs were associated with cellular and metabolic processes and may be involved in the regulation of gene expression. Differentially expressed HDM genes identified in NAFLD may provide value to understanding pathogenesis and in the development of epigenetic therapeutic targets. However, on the basis of the inconsistent results of in vitro studies, future in vivo experiments combined with transcriptomic analysis are needed for further validation.