Ultrasound (US) combined with magnetic resonance imaging (MRI) in the diagnosis of primary hepatocellular carcinoma (PHCC) and recurrent hepatocellular carcinoma (RHCC) were compared. The clinical data of 329 patients with hepatocellular carcinoma (HCC) admitted to Qingdao Women and Children's Hospital from June 2015 to December 2017 were collected. One hundred and sixty patients with PHCC were regarded as the PHCC group, and the other 169 patients with RHCC were regarded as the RHCC group. US and MRI were used in the imaging diagnosis of both groups and the results of US combined with MRI, US, and MRI alone were compared. The lesion size in the PHCC group was significantly higher than that in the RHCC group (P<0.05). The MRI fast-in and fast-out rates of the two groups were significantly higher than those of the other three methods (P<0.05). The coincidence rate of MRI in the two groups was higher than that of computed tomography (CT), US, and US combined with MRI (P<0.05). The coincidence rates of CT, US, MRI, and US combined with MRI in PHCC group were significantly higher than those in RHCC group. In PHCC group, MRI was superior to the other methods in the detection of micro HCC (P<0.05). In RHCC group, MRI was significantly better than US in the detection of micro HCC (P<0.05). The sensitivity, specificity, positive predictive value and negative predictive value of MRI were significantly better than the other three methods (P<0.05). MRI alone has the best diagnostic efficacy for micro HCC-type lesions. The diagnostic efficacy of MRI, US, CT, and US combined with MRI in PHCC was better than those in RHCC. In addition to imaging examination, the diagnosis of RHCC should be combined with other indicators for comprehensive diagnosis.