We measure rotation periods for 12151 stars in the Kepler field, based on the photometric variability caused by stellar activity. Our analysis returns stable rotation periods over at least six out of eight quarters of Kepler data. This large sample of stars enables us to study the rotation periods as a function of spectral type. We find good agreement with previous studies and vsini measurements for F, G and K stars. Combining rotation periods, B-V color, and gyrochronology relations, we find that the cool stars in our sample are predominantly younger than ~1Gyr.