Strong gravitational lensing is an extremely clean probe of dark energy and dark matter. Gravitational time delays in combination with state of the art modeling techniques provide absolute distances to individual lenses with 5% precision. Thus small samples of lenses measure the dark energy equation of state with comparable precision to other popular cosmographic tools like baryonic acoustic oscillations. The so-called flux ratio and astrometric anomalies provide a direct measurement of the mass function of dark matter subhalos and thus a unique way to probe the nature of dark matter. Recent studies have shown that subhalos as small as 1e8 solar masses can be detected at cosmological distances with current technology, limited by angular resolution. The power of these methods is currently limited by the small sample sizes available. Upcoming surveys like DES and LSST will revolutionize the field providing samples of 1000s of strong gravitational lenses. Identifying, following up, and modeling such large samples of lenses with high precision will be challenging but potentially transformative for our understanding of dark matter and dark energy.