Hydrogen and helium are the most abundant elements in the universe and, in principle, are the simplest elements. Nonetheless, they display remarkable properties under pressure that have fascinated theoreticians and experimentalists for over a century. Recent advances in computational methods have made it possible to elucidate many of these properties. We review some of the computational methods that have been applied to dense hydrogen and helium in recent years, mainly those that perform a simulation directly from the physical picture of electrons and ions; primarily, those based on density functional theory and quantum Monte Carlo methods. We then discuss the predictions from such methods as applied to the phase diagram of hydrogen, including the solid and fluid phases, with particular focus on the crystal structures, the liquidliquid transition and comparison of the results with experimental shock-wave data. We then discuss predictions of ordered quantum states, including a possible low-temperature fluid and high-temperature superconductivity in the atomic state. We also briefly discuss pure helium, and then focus on hydrogen-helium mixtures, with particular focus on properties of relevance to planetary science.