This book provides a challenging and stimulating introduction to the contemporary topics of complexity and criticality, and explores their common basis of scale invariance, a central unifying theme of the book.Criticality refers to the behaviour of extended systems at a phase transition where scale invariance prevails. The many constituent microscopic parts bring about macroscopic phenomena that cannot be understood by considering a single part alone. The phenomenology of phase transitions is introduced by considering percolation, a simple model with a purely geometrical phase transition, thus enabling the reader to become intuitively familiar with concepts such as scale invariance and renormalisation. The Ising model is then introduced, which captures a thermodynamic phase transition from a disordered to an ordered system as the temperature is lowered in zero external field. By emphasising analogies between percolation and the Ising model, the reader's intuition of phase transitions is developed so that the underlying theoretical formalism may be appreciated fully. These equilibrium systems undergo a phase transition only if an external agent finely tunes certain external parameters to particular values.Besides fractals and phase transitions, there are many examples in Nature of the emergence of such complex behaviour in slowly driven non-equilibrium systems: earthquakes in seismic systems, avalanches in granular media and rainfall in the atmosphere. A class of non-equilibrium systems, not constrained by having to tune external parameters to obtain critical behaviour, is addressed in the framework of simple models, revealing that the repeated application of simple rules may spontaneously give rise to emergent complex behaviour not encoded in the rules themselves. The common basis of complexity and criticality is identified and applied to a range of non-equilibrium systems. Finally, the reader is invited to speculate whether self-organisation in non-equilibrium systems might be a unifying concept for disparate fields such as statistical mechanics, geophysics and atmospheric physics.Visit for animations for the models in the book (available for Windows and Linux), solutions to exercises, as well as a list with corrections.