This textbook provides an introduction to string field theory (SFT). String theory is usually formulated in the worldsheet formalism, which describes a single string (first-quantization). While this approach is intuitive and could be pushed far due to the exceptional properties of two-dimensional theories, it becomes cumbersome for some questions or even fails at a more fundamental level. These motivations have led to the development of SFT, a description of string theory using the field theory formalism (second-quantization). As a field theory, SFT provides a rigorous and constructive formulation of string theory.The main focus of the book is the construction of the closed bosonic SFT. The accent is put on providing the reader with the foundations, conceptual understanding and intuition of what SFT is. After reading this book, the reader is able to study the applications from the literature. The book is organized in two parts. The first part reviews the notions of the worldsheet theory that are necessary to build SFT (worldsheet path integral, CFT and BRST quantization). The second part starts by introducing general concepts of SFT from the BRST quantization. Then, it introduces off-shell string amplitudes before providing a Feynman diagrams interpretation from which the building blocks of SFT are extracted. After constructing the closed SFT, the author outlines the proofs of several important properties such as background independence, unitarity and crossing symmetry. Finally, the generalization to the superstring is also discussed.