In combinatorics, one often considers the process of enumerating objects of a certain nature, which results in a sequence of positive integers. With each such sequence, one can associate a generating function, whose properties tell us a lot about the nature of the objects being enumerated. Nowadays, the language of generating functions is the main language of enumerative combinatorics. This book is based on the course given by the author at the College of Mathematics of the Independent University of Moscow. It starts with definitions, simple properties, and numerous examples of generating functions. It then discusses various topics, such as formal grammars, generating functions in several variables, partitions and decompositions, and the exclusion-inclusion principle. In the final chapter, the author describes applications of generating functions to enumeration of trees, plane graphs, and graphs embedded in two-dimensional surfaces. Throughout the book, the reader is motivated by interesting examples rather than by general theories. It also contains a lot of exercises to help the reader master the material. Little beyond the standard calculus course is necessary to understand the book. It can serve as a text for a one-semester undergraduate course in combinatorics.