An effective blood-based method for the diagnosis and prognosis of hepatocellular carcinoma (HCC) has not yet been developed. Circulating tumour DNA (ctDNA) carrying cancer-specific genetic and epigenetic aberrations may enable a noninvasive 'liquid biopsy' for diagnosis and monitoring of cancer. Here, we identified an HCC-specific methylation marker panel by comparing HCC tissue and normal blood leukocytes and showed that methylation profiles of HCC tumour DNA and matched plasma ctDNA are highly correlated. Using cfDNA samples from a large cohort of 1,098 HCC patients and 835 normal controls, we constructed a diagnostic prediction model that showed high diagnostic specificity and sensitivity (P < 0.001) and was highly correlated with tumour burden, treatment response, and stage. Additionally, we constructed a prognostic prediction model that effectively predicted prognosis and survival (P < 0.001). Together, these findings demonstrate in a large clinical cohort the utility of ctDNA methylation markers in the diagnosis, surveillance, and prognosis of HCC.