A lottery is a gambling game in which you purchase numbered tickets and try to win prizes by matching numbers that are randomly drawn. The odds of winning can vary wildly, and prizes may be anything from a few dollars to millions of dollars. Many states and the District of Columbia operate lotteries.

The practice of giving away property or slaves by lottery dates back centuries. The Old Testament includes instructions that Moses should conduct a census of Israel and divide land by lot, and Roman emperors used lotteries to give away property and slaves at Saturnalian feasts. The first modern lotteries began in the early 16th century, when Francis I of France authorized them to raise funds for towns and military projects.

After World War II, many states used lotteries to raise money for social safety-net programs and other services. The state-run Staatsloterij in the Netherlands is the oldest running lottery, founded in 1726. Lotteries can be a useful way to raise money for public purposes, but they’re also widely considered to be a form of hidden tax that hurts poor people.

Some lotteries have fixed prize funds; others distribute a percentage of the total receipts. The latter approach carries less risk for the organizer, but it does not guarantee that there will be enough winners to justify the cost of purchasing a ticket. Some lotteries have multiple prize categories and allow purchasers to select their own numbers, which increases the likelihood of winning.