Lottery is a gambling game where tickets are sold for a chance to win a prize based on a draw of numbers. It is the most common form of state-regulated gambling. Most states run their own lottery games, but private companies also manage a number of online lotteries that allow players to participate in national and international games from the convenience of their homes, offices, football stadiums or local pubs.

Almost every state in the United States has a lottery, and it is one of the most popular forms of gambling in the country. It’s a huge part of American culture, with people spending upwards of $100 billion on tickets each year. And the state governments that run them promote them as ways to raise revenue for a wide variety of public services, from schools to police departments.

But how meaningful that revenue is and whether it’s worth the trade-off to people losing money is debatable. And then there’s the bigger question of why people play. It’s partly because they just plain like to gamble, and there’s a certain inextricable human impulse to do it.

The first modern public lotteries appeared in Burgundy and Flanders in the 15th century, with towns attempting to raise funds to fortify their defenses or help the poor. These early lotteries were called ventura, and they may have been the model for later public and private raffles.