Random number has many applications, it plays an important role in quantum information processing. It's not difficult to generate true random numbers, the main difficulty is how to certify the random numbers generated by untrusted devices. In [Nature(London) 464, 1021 (2010)], the authors provided us a way to generate certified random number by Bell's theorem. In their scheme, we can use the nonlocal behavior of entangled states to generate certified randomness. But there are entangled states, which admit a local hidden variable model, could not be used in their scheme. We show in our paper that the nonlocal correlations in every entangled state can be used to generate certified randomness, and we use Werner states as an example to show how to quantify the output randomness.