If you bet on March Madness games this year, make sure you understand the Internal Revenue Service (IRS) rules around taxes and any money you might win from gambling. Whether you score your wins through an informal office bracket or a big-league betting environment, you're legally required to pay taxes on those funds. Here are the things you need to know about your March Madness money and what you might owe in taxes.

Know your tax forms

Just like any additional form of income, your gambling wins must be reported in Form 1040 (line 21, to be exact). This includes money won through any form of gambling, including sports betting like those on March Madness games, lottery tickets, horse races, casino games and large non-cash prizes like cars or trips.

Click here for more from Investopedia.com
Slideshow: The top-paid commissioners

"Comp" stays or non-monetary visits offered by casinos or hotels are also considered income and the value of the services you receive for free must be included as part of your total winnings. Married couples filing jointly combine their winnings and losses in one monetary sum, and report just one figure.

For certain winnings, the entity awarding you the cash or prize is required to take record of your personal information and issue you a Form W-2G, which is the "gambling version" of a standard W-2 that you receive each year from an employer. These funds also need to be reported on Form 1040. Further, you may be required to pay an estimated tax on your gambling winnings before "formal tax season," depending on the amount you won.

You will be issued a Form W-2G If you win $600 or more in a state lottery, horse or dog race, or if what you won is more than 300 times your wager. The same holds true for winnings of $1,200 or more from bingo and slot machines, and winnings of $1,500 or more from keno (less what you spent on the winning ticket). Table games like black jack and roulette do not trigger the issuance of a W2-G (but you still must report the winnings on your Form 1040, and the income from your win taxable).

The IRS also provides Form 5754 for groups that may collectively bet on, and win, a large prize like the lottery. All necessary tax forms can be found at IRS.gov including the W-2G.

A bright side to losing

There is some good news when it comes to taxes and gambling: You can deduct losses. Provided that you do did not lose more than you won in betting activity, losses must be itemized in order to be claimed on Form 1040 (line 28). According to CCH Principal Federal Tax Analyst Mark Luscombe, the trick to successfully using tax laws to your advantage is to maintain extremely detailed transparent records of all transactions. "When reporting gambling wins and losses, you have to keep those numbers separate. You can't combine your win-loss totals and only report the difference – it really needs to be a clear record of everything you won and lost over the course of the year."

In order to prove your ups and downs, maintain all printed transaction and communication records regarding bets placed, in addition to your own personal win-loss score sheet. CCH also recommends keeping all the following information for complete records: Name and address of gaming establishment and the date of activity, specific games or wagers made, amount won, amount lost, credit card or debit card transaction receipts, ATM withdrawals, betting slips and ticket stubs.

Don't forget the state tax

It's also important to note that state taxes apply to gambling winnings, in addition to Federal tax. If you won the money in a state you do not reside in, most states offer a credit to their residents for taxes paid to other states. For example, if you win money in Las Vegas but live in Ohio, you would pay tax on your winnings to the state of Las Vegas in a non-resident filing. Ohio would in turn credit that amount to your Ohio state tax return.

The bottom line

The government takes taxes on gambling seriously; failure to comply to tax rules can result in being made to pay additional penalties, and in some cases, a prison sentence. Staying aware of the tax rules will ensure that you'll get the most out of your March Madness wins and losses.

More from Investopedia.com:

The money behind the NFL players' lawsuit
Personal income tax guidelines
Five ways March Madness makes money