The cosmic microwave background (CMB) is the radiation left over from the Big Bang. Recent analysis of the fluctuations in this radiation has given us valuable insights into our Universe and its parameters. Examining the theory of CMB and recent developments, this textbook starts with a brief introduction to modern cosmology and its main successes, followed by a thorough derivation of cosmological perturbation theory. It then explores the generation of initial fluctuations by inflation. The Boltzmann equation governs the evolution of CMB anisotropies and polarization is derived using the total angular momentum method. Cosmological parameter estimation and the lensing of CMB fluctuations and spectral distortions are also discussed. This textbook is the first to contain a full derivation of the theory of CMB anisotropies and polarization. Ideal for graduate students and researchers in this field, it includes end-of-chapter exercises, and solutions to selected exercises are provided.