Abstract The electronic structure of yttrium trihydride (YH3) under pressure has been explored by using the first-principle calculation. The existence of semiconductor phase of YH3 is predicted at low pressure with symmetry group p 3 ¯ c 1 $p\overline{3}c1$ (165). In the range of 10–24 GPa, electron- and hole-like bands near the Fermi level are overlapped and form a snake-like nodal ring around Γ point. Different from previous literature (D. Shao, T. Chen, Q. Gu, et al., “Nonsymmorphic symmetry protected node-line semimetal in the trigonal YH3,” Sci. Rep., vol. 8, 2018.; J. Wang, Y. Liu, K.-H. Jin, et al., Phys. Rev. B, vol. 98, p. 201112, 2018), which assumes the band degeneracy is protected by mirror symmetry, we argue that the nodal line is protected by the space inversion symmetry and the time reversal symmetry. For weak spin-orbital coupling (SOC), the fermion modes at the band crossings are real 3D Majorana fermions. This is a typical double charged nodal-line semimetal, meaning that there are two topological invariants of this nodal line: a 1D Berry’s phase and a Z 2 monopole charge, which are related to the first and the second Stiefel-Whitney classes of the Berry bundle and can be given by the first-principle calculation. It turns out that the 1D Berry’s phase is nontrivial, but the Z 2 monopole charge is trivial. Therefore, this nodal line can shrink to a point and gapped out without breaking the topological constraints.