Lottery is a form of gambling in which participants pay for a chance to win a prize. The prize can be cash, goods or services. Lotteries are legal in most states. Federal law prohibits the direct sale of lottery tickets through mail or phone and the sending of promotions for lotteries in interstate or foreign commerce. The winner is selected by drawing or matching a lucky number. The chances of winning vary according to the type of game and the price of a ticket.

The history of lotteries stretches back thousands of years. The Old Testament has several passages that instruct Moses to divide land by lot, and the Roman emperors gave away slaves and property during Saturnalian feasts. In the Low Countries in the 15th century it was common to organize public lotteries for a variety of purposes, including town fortifications and helping the poor.

Modern lotteries are often government-sponsored and offer prizes ranging from cash to vehicles, computers and other technology. The lottery is usually operated by a central agency or commission, which selects and trains retailers, sells tickets, redeems winning tickets, pays high-tier prizes, assists retailers in promoting the game and ensures that state laws are followed. Many state lotteries also provide educational and medical services to their citizens. The prize fund may be a fixed amount of money or a percentage of the total revenue from the sale of tickets. A percentage of the proceeds is also earmarked for charitable or social programs.