If you shop at Costco, you may now have a new credit card. That's because last week Costco switched from providing its customers with the Costco American Express TrueEarnings card to the new Citi Costco Anywhere Visa.

The new card is an improvement over TrueEarnings. It gives you more cash back for gas, restaurant, travel, and Costco purchases.

But is it the best cash back card for shopping at Costco or at other stores?

To find out, we turned to our Credit Card Adviser Comparison Tool. We input the amount that the average U.S. household spends per month on gas, travel, groceries, restaurants and other expenses, according to data from the Bureau of Labor Statistics. We assumed that the entire amounts were charged to a credit card.

The Credit Card Adviser Comparison Tool then calculated the cash rewards that would be earned on 55 popular cards, net of any annual fees and other costs.

The result: We found that the Citi Costco Anywhere card could earn $884 in cash back over the first three years that it is used.

Costco, though, says that the amount of cash back is actually higher. Richard Galanti, Costco's chief financial officer, says that using the same data from the Bureau of Labor Statistics, the Citi Costco Anywhere Visa card would pay $1,117 in cash back over three years.  

Why the difference? Costco says that its card has no annual fee so we shouldn't include a fee in our calculations. But since you can't get the card without being a Costco member, which costs $55 per year, our tool includes that cost in the calculations.

Another difference: The Credit Card Adviser Comparison Tool calculates that the card gives you back 1 percent cash back, because that's the amount you’d receive if you used it at most retailers. When you use it at Costco, though, you get more—2 percent cash back—for most charges that you make. (Costco gives 4 percent cash back on gas that you buy at Costco or anywhere else.)

This means that if you intend to use your Citi Costco credit card at Costco, you’ll get more cash back than our tool now calculates.

"We structured the card in a way that we think is most valuable to our members who have it," says Galanti.

Whether you use our online credit card tool to calculate your possible cash back or Costco's method, our tool found that you can do better. According to the Credit Card Adviser Comparison Tool, you could earn more cash back with the Fidelity Rewards Visa Signature card, whether you shop at Costco or anywhere else.

Using all the same expenditures, the Fidelity card gives you $1,207 in cash back over three years.  

To find the cash-back card that's best for you, plug your own expenses into our Credit Card Adviser Comparison Tool. You may be surprised to find that you could be earning more cash back than you now are on your purchases.