In computer science, the space complexity of a computer program is the amount of memory space required for its proper execution.

The term is an approximation to the original meaning of the term in computational complexity theory, where it has a formal mathematical definition.

See also time complexity.