This article reviews how nuclear fission is described within nuclear density functional theory. In spontaneous fission, half-lives are the main observables and quantum tunnelling the essential concept, while in induced fission the focus is on fragment properties and explicitly time-dependent approaches are needed. The cornerstone of the current microscopic theory of fission is the energy density functional formalism. Its basic tenets, including tools such as the HFB theory, effective two-body effective nuclear potentials, finite-temperature extensions and beyond mean-field corrections, are presented succinctly. The EDF approach is often combined with the hypothesis that the time-scale of the large amplitude collective motion driving the system to fission is slow compared to typical time-scales of nucleons inside the nucleus. In practice, this hypothesis of adiabaticity is implemented by introducing (a few) collective variables and mapping out the many-body Schrodinger equation into a collective Schrodinger-like equation for the nuclear wave-packet. Scission configurations indicate where the split occurs. This collective Schrodinger equation depends on an inertia tensor that includes the response of the system to small changes in the collective variables and also plays a special role in the determination of spontaneous fission half-lives. A trademark of the microscopic theory of fission is the tremendous amount of computing needed for practical applications. In particular, the successful implementation of the theories presented in this article requires a very precise numerical resolution of the HFB equations for large values of the collective variables. Finally, a selection of the most recent and representative results obtained for both spontaneous and induced fission is presented with the goal of emphasizing the coherence of the microscopic approaches employed.