For investors in search of relatively safe yield, hiding out in a certificate of deposit is finally paying off. Bank CDs are among the fixed-income investments that are enjoying a surge in popularity as the Federal Reserve raises interest rates. Bond yields have ticked higher, and just last week the rate on the 3-month Treasury surpassed 5% , rewarding investors who want to earn interest on short-term cash holdings. Lately, CDs from online banks are seeing higher rates on 1-year instruments. That includes Ally Bank , which recently boosted the yield on its 1-year CD by 25 basis points to 4.5% and SLM , which hiked its rate by 10 basis points to 4.6%, according to data from Stephens. The inverted yield curve – in which yields on shorter-dated Treasury bills are higher than those on longer-dated bonds – has also been a boon for CD investors. “You don’t get paid much more for locking up your money for five years versus one year,” said Christine Benz, director of personal finance at Morningstar. “This isn’t very familiar for many people. They assume the longer your term, the more you should get paid.” Indeed, five-year CDs at Ally Bank and SLM offer an annual percentage yield of 4.25%. Another key benefit of bank CDs: At a time when Silicon Valley Bank’s failure highlighted the safety of bank deposits, it’s worth noting that bank CDs are protected by the Federal Deposit Insurance Corp. They are backed up to $250,000 per account owner, per bank. Shopping for the best terms Online banks are offering some of the most attractive rates on CDs. Investors have taken notice, as deposit balances at these institutions gained 13% year over year in the fourth quarter, Stephens found. See below for the latest rates on 1-year CDs from online banks as of March 10, according to the firm. Yields are just one factor when you’re searching for a place to park some cash. The liquidity trade-off should be top of mind for investors shopping for CDs: You’re locked into this investment until the term ends unless you’re willing to pay for an early withdrawal. These penalties can vary from one bank to another, but generally you’re sacrificing the interest you would’ve earned in a specified period. The term of the CD is another consideration. While shorter-dated instruments are paying high yields at select banks, you’re facing reinvestment risk at maturity. “The longer-term CD is the bird in the hand, but with the short-term CD you’re stuck with having to reinvest in six months or a year from now,” said Benz. There’s a chance that rates may be less attractive at that point. A CD ladder can help address some of this risk. That means you’re buying CDs of different maturities and then reinvesting your proceeds as they mature. When rates fall, you can rely on longer-dated CDs that have already locked in the higher yield. Know the catches It’s worth noting that while you can hunt for good yields in CDs, the amount of income you get isn’t going to keep up with the rate of inflation over the long term. Individual CDs and ladders might make the most sense for only a portion of your portfolio. Further, you could be on the hook to the tax man for the interest you earn on CDs. CDs pay interest income , which is taxed as ordinary income and subject to rates ranging from 10% to 37%, depending on your tax bracket. One option is to defer taxes on interest by holding the CD in a tax-advantaged account. “Now that the yields are higher, the tax impact is more significant, so it pays to be thoughtful about what tax haircut you will pay,” said Benz. —CNBC’s Michael Bloom contributed to this report.