I have a lot of credit cards. Between my wife and me, we have 20, to be exact. We’ve each had cards in our names since we started college and have added to the collection nearly every year since.

But we don’t actively use many of those cards, so I decided to streamline our wallets. My goal? Decrease the number of cards without jeopardizing our credit scores. My target was to keep three to five of the accounts.

My first step was to identify all the cards we use regularly. The next steps were designed to protect our credit scores: Set aside our oldest cards to preserve our longest-lived accounts. Then, out of what was left, save the cards with significant credit lines, with the goal of protecting our overall credit line and utilization ratios.

After all that, I realized my target was wildly off. Turns out we’re keeping 14. Here’s why.

I generally recommend consumers carry about three cards in their wallet, including:

To apply that logic to our 20 cards, we have two for our top spending categories: the Discover it® - Cashback Match™, my favorite rotating category cash-back card, and the Chase Sapphire Reserve℠, for travel and dining. For favorite merchants, we have three store cards and one airline card: the Amazon Prime Store Card, the Gap credit card, Target RedCard and the United MileagePlus® Explorer Card. Finally, we have the Citi®Double Cash Card – 18 month BT offer, my favorite flat-rate card, for everything else. That’s seven cards for our core wallet.

One more to add: I bought a Mac computer on a deferred-interest store credit card deal last February. It’s not a great card, and the credit limit is low, so I’ll close the card as soon as the balance is paid off. (Side note: Take care with deferred-interest credit card deals. If any balance remains when the introductory period closes, the entire interest balance is due. Always pay the balance off in full before the deferral period ends.)

If you’re keeping score, that’s eight cards retained so far.

An important input to your credit score is the average age of your accounts, which basically helps the credit bureaus know how long you’ve been able to stay on top of your financial obligations. The higher this average is, the better, so retaining your older cards can help keep that average high, even as you open new cards.

Three of my cards are staying in my wallet — or, more accurately, my safe — only because I’ve had them forever. My wife and I each have a Wells Fargo Platinum Visa® Credit Card, mine with 11.3 years to my name and my wife’s with 8.1, making it the oldest card for each of us. I also have a Citi Simplicity® Card - No Late Fees Ever with 11 years of service, so I’ll keep that one, too.

An important note for keeping old cards on your credit report: You still need to use them periodically for them to help your score, for two reasons. First, if you ignore the card for too long, your bank can close it without notice. To avoid that, I recommend using each of your cards at least annually. Second, cards that have been inactive for even a couple of months are often not factored into credit scoring algorithms, even if they still appear on your credit report.

To avoid both of these problems, I make sure to spread all of my recurring bills like internet, Netflix, utilities, etc. across my otherwise inactive cards. This ensures regular, monthly charges, with virtually no thought on my part. It also has the added benefit that in case one of my regular-use cards is compromised, I don’t need to go through bill-pay setup all over again.

So that’s three more cards retained thus far, for a total of 11.

Two important metrics in your credit score are overall credit line and credit utilization ratios. The second of those, especially, is a mouthful, but both are fairly straightforward.

Overall credit line is the total of all of your credit lines and essentially measures how much money banks trust you with. The higher, the better.

Credit utilization measures the amount of that total limit you actually use, essentially how much of it you need. This is measured both on a per-card basis and as the sum of all of your cards. The lower you can get this ratio, the better, but a rough rule of thumb is to try to keep both your per-card balances and the sum of all card balances below 30% of their limits.

A quick aside to illustrate: A few weeks ago I put a hotel stay on a card with a low credit limit, immediately bringing the balance to over 50% of the card’s limit. That mistake cost my credit score 15 points immediately.

Any cards I close at this point will hurt my credit by decreasing my overall credit limit and drive my credit utilization ratio up. So I want to make sure that none of the cards I cut is contributing significantly to these metrics.

After running my 20 cards through the two passes above, I was left with nine cards, three of which have significant credit lines. My Capital One® Venture® Rewards Credit Card makes up 16% of my overall credit limit; US Bank’s REI MasterCard® Credit Card makes up 12%; and my Chase Sapphire makes up 10%. So I’ll keep those around as well.

An important caveat on keeping cards just to protect your credit limit: If a card has an annual fee, it’s not worth it. Out of these three, the Capital One® Venture® Rewards Credit Card does have an annual fee, but I plan to try to get the fee waived or downgrade to a card that doesn’t charge that fee. If that approach doesn’t work, I’ll close the card and accept the credit ding.

So add three more cards, and the final tally comes out to 14.

There are a number of fair objections to closing cards; in most cases it’s best to keep them open. But for me, the only negative factor in my credit score is my low average history of accounts — meaning I’ve opened too many cards in recent years — so I want to boost that average. By cutting the six cards that didn’t make it through the three passes above, I’m increasing my average card history from 4.7 years to 5.4, which, according to NerdWallet’s credit dashboard, moves me from the “poor” to “average” range.

On the downside, cutting those six cards decreases my overall credit line by 17%. That’s a real loss, but since my overall credit utilization ratio will remain in the “excellent” range and I’ll boost my average history of accounts, I view this as a worthwhile trade with minimal negative impact to my credit score.

I can feel one nagging question remaining: Isn’t 14 cards still excessive? Yes, it is. But at this point I can’t backtrack without sacrificing my credit score, and I have little, if anything, to gain by that loss.

Fourteen accounts means a lot to keep track of, but it’s doable, by listing important account details in a spreadsheet and tracking each card’s transactions in a budgeting app. If you don’t think you can balance so many cards, or simply don’t want to, stick with a few cards you know you’ll stay on top of.

Ultimately, the right number of cards for you is, like all of personal finance, a personal decision. Pick cards that give you the most back for your purchases and keep less-favored cards in the lineup if only to boost your credit score. More rewards and a higher credit score are key ingredients to our common goal: financial freedom. Good luck.

Sean McQuay is a credit cards expert at NerdWallet. A former strategist with Visa, McQuay now helps consumers use their credit cards more effectively. If you have a question about credit, shoot him an email at asksean@nerdwallet.com. The answer might show up in a future column.

The article Sean Talks Credit: Is 20 Cards Too Many? Here’s How to Streamline Your Wallet originally appeared on NerdWallet.