In economics, utility function is an important concept that measures preferences over a set of goods and services. Utility is measured in units called utils, which represent the welfare or satisfaction of a consumer from consuming a certain number of goods. Because satisfaction, happiness or welfare is a highly abstract concept, economists measure utility in terms of revealed preferences by observing consumer choices and creating an ordering of consumption baskets from least desired to the most preferred.

Economists create a parametric functional form for the utility based on the assumption of observed consumer behavior, with a number of goods as variables and certain fixed parameters. After that, utility is calculated by substituting certain numerical values for the consumption of goods in the utility function. (For related reading, see "The Concept of Utility.")

In economics, the utility function measures the welfare or satisfaction of a consumer as a function of consumption of real goods such as food, clothing and composite goods rather than nominal goods measured in nominal terms. Utility function is widely used in the rational choice theory to analyze human behavior.

To postulate the utility function, economists typically make assumptions about the human preferences for different goods. For example, in certain situations, tea and coffee can be considered perfect substitutes for each other, and the appropriate utility function must reflect such preferences with a utility form of u(c, t) = c + t, where "u" denotes the utility function and "c" and "t" denote coffee and tea. A consumer who consumes one pound of coffee and no tea derives a utility of 1 util. (For related reading, see "Economics Basics: Utility.")