Increasing the refractive index available for optical and nanophotonic systems opens new vistas for design: for applications ranging from broadband metalenses to ultrathin photovoltaics to high-quality-factor resonators, higher index directly leads to better devices with greater functionality. Although standard transparent materials have been limited to refractive indices smaller than 3 in the visible, recent metamaterials designs have achieved refractive indices above 5, accompanied by high losses, and near the phase transition of a ferroelectric perovskite a broadband index above 26 has been claimed. In this work, we derive fundamental limits to the refractive index of any material, given only the underlying electron density and either the maximum allowable dispersion or the minimum bandwidth of interest. The Kramers--Kronig relations provide a representation for any passive (and thereby causal) material, and a well-known sum rule constrains the possible distribution of oscillator strengths. In the realm of small to modest dispersion, our bounds are closely approached and not surpassed by a wide range of natural materials, showing that nature has already nearly reached a Pareto frontier for refractive index and dispersion. Surprisingly, our bound shows a cube-root dependence on electron density, meaning that a refractive index of 26 over all visible frequencies is likely impossible. Conversely, for narrow-bandwidth applications, nature does not provide the highly dispersive, high-index materials that our bounds suggest should be possible. We use the theory of composites to identify metal-based metamaterials that can exhibit small losses and sizeable increases in refractive index over the current best materials.