Official lottery is a competition, often run by a government, in which numbered tickets are sold for the chance to win a prize (such as money or goods). The prizes can be anything from sports team drafts to real estate and even cars. Many people play the lottery as a form of gambling, while others use it to raise money for public services.

Lotteries first appeared in the Low Countries in the 15th century, where towns used them to raise funds for town fortifications and the poor. A popular example was the Elizabethan Prize Is Right, a game in which participants bought ticket entries for one week’s immunity from arrest for any crime bar murder, piracy, and treason, along with a prize of “good linnen cloth”.

By the early 19th century, state governments began to adopt them as a way of raising funds. But they were met with widespread opposition from devout Protestants, who argued that state-sponsored gambling was morally wrong. Lottery opponents were also concerned about the amount of money that states stood to gain, as they would be able to fund their own projects through lottery proceeds rather than resorting to taxes.

Today, there are 48 state lotteries in the United States, as well as the District of Columbia and Puerto Rico. While some of these operate independently, two multistate games—Mega Millions and Powerball—represent the de facto national lottery. The governing bodies of these lotteries vary, but they all share the same goal: to raise revenue for government-funded programs.