Thanks to the passage of the Fair Credit Billing Act, liability for unauthorized charges made with credit is limited to $50 for both in-person and online credit transactions as long as you report the incident within 60 days.
However, as noted above, most credit cards offer zero fraud liability, meaning you won't be on the hook for a penny. Most credit card issuers will put the fraudulent charge on hold while they conduct an investigation so that you won't be out the money in the interim, either.
Debit cards, though, are a different story. Since the money you spend comes out of your bank account, you may have to wait days or weeks to get a refund for a fraudulent transaction made with your card. Further, your liability jumps to $500 if you don't catch the fraudulent transaction within two business days – and you could even have your bank account drained with no recourse after that.
Here's how the Federal Trade Commission words it: If a fraudulent transaction made with debit goes unreported for more than 60 days after your statement is sent, you could be on the hook for "all the money taken from your ATM/debit card account, and possibly more; for example, money in accounts linked to your debit account."
Also: The best starter credit cards for no credit
Use a credit card for online purchases: It will offer more consumer protections than a debit card does in the event of fraud.