Nonlocality certifies that the outputs of a measurement did not pre-exist, which in particular means that they were unpredictable or random. In other words, nonlocality certifies randomness in a device-independent way. This chapter introduces the main tools for the study and quantification of randomness: process randomness, the need for a predictor or adversary, and guessing probability. Examples are then explicitly worked out, and a review of more advanced results is provided.