The lottery is a game of chance in which you buy tickets and win a prize based on random numbers. You can find lottery games at convenience stores, gas stations and online. The prize money can be anything from a free ticket to a brand-new car. The chances of winning are low, but many people play to win the big jackpots.

The history of lotteries goes back centuries, although the modern state-run variety began in 1964. It’s a popular form of gambling, with broad public approval in states that have it. Lotteries have gained popularity in times of economic stress because they can be framed as helping to fund public goods, like education. They’ve also enjoyed wide support in times of stability, as evidenced by the fact that they’re still running in all 44 states that have them, per NerdWallet.

Lottery games make money primarily by selling tickets, and the amount that doesn’t go to winners ends up in state coffers. Each state has complete control over what it does with that money, and most put a portion of it into its general fund for things like roadwork, bridge work, police force and other government services.

A portion of your purchase also goes towards the cost of running the lottery system, which includes employees who design scratch-off games, record live drawings and help winners after they hit it big. These expenses are why a small percentage of your winnings is deducted from the total prize amount.