We develop the theory of Krull dimension for S4-algebras and Heyting algebras. This leads to the concept of modal Krull dimension for topological spaces. We compare modal Krull dimension to other well-known dimension functions, and show that it can detect differences between topological spaces that Krull dimension is unable to detect. We prove that for a T1-space to have a finite modal Krull di...