Online bank and financial technology upstart SoFi Technologies (SOFI 3.69%) has huge ambitions. It is growing quickly, adding billions of dollars in new deposits every quarter. This has many investors -- both on Wall Street and Main Street -- bidding up the stock. Shares of SoFi rose by 75% in the past 12 months, making it one of the best-performing stocks of 2023.

But what if I told you there was a better online bank stock than SoFi? Enter Ally Financial (ALLY 0.41%). It's time to zig while everyone is zagging and buy this online banking powerhouse in 2024.

What is Ally Financial?

Ally Financial was born out of the financial crisis, when General Motors was forced to spin off its lending operation, GMAC (General Motors Acceptance Corporation). That institution was renamed Ally in 2009, and has operated as an independent online-only bank ever since.

The bank has two main focuses. First, it aims to attract younger depositors by offering higher interest rates on checking and savings accounts than the largest banks. Ally is able to do so while remaining profitable due to lower overhead costs. It has no physical bank branches and runs way leaner on its employee count than traditional banks, giving it a cost advantage that it can pass on to customers. This has enabled Ally to increase its customer count for 58 straight quarters. It now has $140 billion in retail deposits.

With these deposits, Ally has remained a leader in auto loans. At the end of last quarter, it had more than $115 billion in auto loans on its balance sheet earning interest income. Even though Ally pays depositors 4.35% on their savings accounts, it has a positive net interest margin due to the profitability of its auto loan operation. During the past 12 months, Ally generated $1.22 billion in net income, and it has been profitable in each of the past five years.

The stock is cheap

Though the bank has been putting up consistent growth, its stock is down by 38% from the all-time high it hit in 2021. After the Federal Reserve started raising interest rates to combat inflation, banks in the U.S. started running into trouble. They had to pay more to depositors, and their existing loan books decreased in value. This double whammy even put a few banks out of business in early 2023.

Ally was not immune to this pain. However, unlike Silicon Valley Bank and the others that failed in 2023, it weathered the storm. Its net interest margin was compressed in recent quarters due to higher interest rates paid to depositors, but its loan portfolio is performing well and turning over with higher interest rates that are adjusting to the Fed's rate hikes. For example, in Q3 2022, Ally's retail automotive loans were yielding 7.22%. A year later, this number had risen to 8.9%.

Now, it looks like the Fed is done raising interest rates for this cycle, and may even begin to cut rates at some point this year. Once Ally's entire loan book reprices, its net interest margin should start expanding again and its earnings should grow. Plus, the bank continues to add deposits, giving it the capacity to make even more loans in the coming years.

Despite its earnings decline, Ally trades at a price-to-earnings ratio of less than 10, which is well below the market average. With the headwinds of rising interest rates behind it and with the bank increasing its deposits, I am confident that its earnings have a lot of room to grow this decade as well. This makes Ally stock a bargain at these prices.

SOFI Net Income (TTM) Chart

SOFI Net Income (TTM) data by YCharts.

Why it is a better buy than SoFi

Now, let's get to SoFi. There are three reasons I think Ally is a better bet now for investors than SoFi. First is its profitability. Ally has been profitable for each of the past five years and generates more than $1 billion in earnings annually. SoFi has never generated a profit, and it had net losses of close to $400 million during the past 12 months.

Second, Ally has a longer track record of gaining depositors and making loans. Yes, SoFi has grown incredibly quickly recently, but that is likely due to its high marketing spending and the higher interest rates it pays on its savings accounts. Ally has increased its deposit base for more a decade, and has done so while generating a profit.

Last, Ally stock is cheaper than SoFi by price-to-book ratio -- the standard metric for valuing a bank. Ally trades at a ratio of less than 1 while SoFi trades is at 1.6 -- a 60% premium to Ally. Add it all up, and Ally Financial looks like the superior stock for investors to own in 2024.