The lottery is a form of gambling in which people buy tickets for a chance to win a prize. Prizes are normally money, goods or services. Ticket sales may be public or private, with the latter often conducted by government-sponsored agencies. In some cases, the prizes may be a combination of both cash and goods or services. The organization of lotteries is complex, requiring rules regulating the frequency and amount of prizes, as well as the costs for organizing and promoting them. A percentage of the total ticket sale is deducted for taxes and profits, and the remaining prize pool is set by the organizer.

The first lotteries were held in the Low Countries in the 15th century for raising funds to build town fortifications and to help the poor. In 1620, Benjamin Franklin sponsored a lottery to raise funds for cannons to defend Philadelphia against the British. The lottery became a popular form of fundraising in colonial America, and by the 1740s there were many private and state-sponsored lotteries. They helped fund roads, libraries, colleges and canals, as well as building churches and supplying the militia.

In the United States, state governments have a monopoly on the sale of lottery tickets. Most states use the proceeds to fund government programs. Some states earmark lottery funds for a particular program, such as public education; critics argue that this simply reduces the appropriations the legislature would have otherwise given to that program from the general fund.