How can redundancy be eliminated from a network, and what can be said about the resulting substructures? In graph-theoretic terms, these substructures are spanning trees. The collection of all spanning trees of a graph has the structure of a matroid basis system; this observation connects trees to algebraic combinatorics and explains why many graph algorithms can be made computationally efficient. The number of spanning trees of a graph measures its complexity as a network, and there are classical and efficient linear-algebraic tools for calculating this number, as well as for enumerating trees more finely. The algebra of trees is key in studying dynamical systems on graphs, notably the abelian sandpile model (known in other forms as the chip-firing game or dollar game), whose possible states are encoded by a group of size equal to the complexity of the underlying graph.This chapter is about the more recent theory of spanning trees in cell complexes, which are natural higher-dimensional analogues of graphs. The theory for cell complexes parallels the graph-theoretical version in many ways, including the connection to matroid theory. However, higher-dimensional spaces can have much richer topology, which complicates the algebraic and enumerative parts of the story in a very concrete way. It turns out that the simple number of spanning trees of a cell complex is not a well-behaved invariant, and it is better to account for topological complexity in the enumeration. On the other hand, many essential algebraic tools for working with spanning trees of a graph do extend well to arbitrary dimension.