A partial function is a mathematical concept where a function is not necessarily defined for every possible input in its domain. This contrasts with a total function, which has an output for every input in its domain, making partial functions particularly useful in computer science for handling undefined or exceptional conditions.