(NEXSTAR) — A record-setting Mega Millions jackpot of $1.58 billion is up for grabs Tuesday night. If you haven’t purchased a ticket yet, you still have time — but maybe not much time, depending on where you live.

The jackpot has been brewing since April when a $20 million prize was won by a ticket sold in Syracuse, New York, just four days after a $483 million Mega Millions jackpot was hit by a ticket sold in Queens.

Ahead of Tuesday’s drawing, Mega Millions officials estimated the jackpot’s size at $1.58 billion with a cash value of $783.3 million. That puts it as the largest in the game’s history, and as the third-largest lottery prize in U.S. history, though that could shift slightly based on ticket sales.

While the Mega Millions drawings are held at 11 p.m. ET on Tuesdays and Fridays, depending on where you live, you may need to get your ticket hours beforehand.

In roughly half of the participating states, ticket sales at retailers end 15 minutes before the drawing. So if you’re buying your ticket in Arkansas, California, Connecticut, Georgia, Illinois, Kentucky, Maryland, Massachusetts, Michigan, New Jersey, New Mexico, North Carolina, Ohio, Tennessee, Texas, Virginia, and Washington, as well as the District of Columbia, you have until 10:45 p.m. ET to test your luck.

Some end ticket sales an hour before the drawing. That includes Florida, Louisiana, Minnesota, Montana, Nebraska, New York, Oregon, South Carolina, South DakotaWisconsin, and Wyoming.

Need slightly more time? In these states, retail lottery ticket sales close one hour and one minute before the drawing: Iowa, Kansas, Missouri, Oklahoma, Pennsylvania, and Virginia. Three states – MaineRhode Island, and Vermont – stop ticket sales at 9:50 p.m. ET.

Here’s when Mega Millions ticket sales end on drawing nights in other states:

The next Mega Millions drawing is at 11 p.m. ET Tuesday.

Some states are better for winners than others

While beating the immense odds to win the Mega Millions jackpot will undoubtedly be a life-changing experience, where you win can have a big impact on it.

Regardless of where you win, about 37% will automatically be withheld thanks to federal taxes. Then, if your state has a lottery tax, you could see even more of your prize money withheld.

New York has the highest state lottery tax withholding on large lottery prizes, like the Mega Millions jackpot, at 10.9% If you live in New York City, you’ll face an additional 3.876% withholding, according to the state lottery. There are, however, some states that don’t automatically withhold a local tax on your prize.

Some states will also reveal your name if you’re the winner, despite advice from experts to keep it a secret.

Want to stay anonymous and keep as much of your jackpot as possible? Wyoming has no automatic lottery tax and allows winners to remain anonymous. Winners in North Dakota can also remain anonymous, and the state’s lottery withholdings are just 2.9%.