Hydrogen could be an important light element in planetary cores, but its effect on phase diagrams of iron alloys is not well known because the solubility of H in Fe is minimal at ambient pressure and high-pressure experiments on H-bearing systems have been challenging. Considering that silicon can be another major light element in planetary cores, here we performed melting experiments on the Fe-Si-H system at ~50 GPa and obtained the ternary liquidus phase relations and the solid/liquid partition coefficient, D of Si and H based on in-situ high-pressure X-ray diffraction measurements and ex-situ chemical and textural characterizations on recovered samples. Liquid crystallized hexagonal close-packed (hcp) (Fe0.93Si0.07)H0.25, which explains the observed density and velocities of the Earth’s solid inner core. The relatively high DSi = 0.94(4) and DH = 0.70(12) suggest that in addition to Si and H, the liquid outer core includes other light elements such as O, which is least partitioned into solid Fe and can thus explain the density difference between the outer and inner core. H and O, as well as Si, are likely to be major core light elements, supporting the sequestration of a large amount of water in the Earth’s core.