Hypofractionated RT has shown encouraging results in hepatocellular carcinoma (HCC) patients. However, HCC adjacent to the gastrointestinal (GI) tract should be carefully treated using the high-precision irradiation technique due to risk of radiation damage. We evaluated the feasibility of a respiratory-gated magnetic resonance image guided radiation therapy (RgMRg-RT) for hepatocellular carcinoma (HCC). Thirty-three patients with HCC underwent RgMRg-RT in our hospital from 2015 to February 2019, including patients with Child-Pugh A/B7 cirrhosis and unresectable tumors near the gastrointestinal tract. The median radiation dose was 50 Gy (range, 25–60) and median fraction number was 5 (range, 4–15). Gating was performed based on real-time magnetic resonance image without an external surrogate. The median follow-up period was 11.7 months (range, 3.6–37.9 months). The rates of local control of the target tumor at 6 months and 1 year were 90.2 and 86.9%, respectively. The overall survival rates at 6 months, 1, and 2 years were 84.3, 76.3, and 61%, respectively. The median distances from gross tumor to the esophagus, stomach, duodenum and colon were 6.1 (range, 1.9-14.3), 6.4 (0-13.4), 3.8 (0-13.5) and 4 cm (0.3-13), respectively. A total of 15 tumors (45.5%) were located within 2 cm of the gastrointestinal tract and 9 tumors (27.3%) within 1 cm. Grades 3 treatment-related bleeding was observed in one patient and one patient had radiation-induced liver disease. Hypofractionated RgMRg-RT was a safe and potentially ablative therapy for HCC. RgMRg-RT is a good alternative treatment for patients with HCCs that are unsuitable for surgical resection or local ablative therapy.