This book is an introduction to the theory of algebraic spaces and stacks intended for graduate students and researchers familiar with algebraic geometry at the level of a first-year graduate course. The first several chapters are devoted to background material including chapters on Grothendieck topologies, descent, and fibered categories. Following this, the theory of algebraic spaces and stacks is developed. The last three chapters discuss more advanced topics including the Keel-Mori theorem on the existence of coarse moduli spaces, gerbes and Brauer groups, and various moduli stacks of curves. Numerous exercises are included in each chapter ranging from routine verifications to more difficult problems, and a glossary of necessary category theory is included as an appendix.