By performing local projective measurements on a two-qubit entangled state one can certify in a device-independent way up to one bit of randomness. We show here that general measurements, defined by positive-operator-valued measures, can certify up to two bits of randomness, which is the optimal amount of randomness that can be certified from an entangled bit. General measurements thus provide an advantage over projective ones for device-independent randomness certification.