An atomic oscillator includes at least a gas cell that has metal atoms sealed therein, a coil that is disposed in a vicinity of the gas cell, a first magnetic shield that accommodates the gas cell and the coil therein, a second magnetic shield that accommodates a heater heating the gas cell, a first temperature sensor detecting a temperature of the gas cell, and the first magnetic shield therein, and a temperature adjustment unit and a second temperature sensor that are disposed outside the second magnetic shield.