Dollar General (DG 0.30%) and Dollar Tree (DLTR -0.14%), the two largest dollar store chains in America, have been resilient stocks to own during recessions. Both retailers usually become popular destinations during economic downturns as cash-strapped shoppers hunt for bargains.

Both companies continued to expand their fleet of brick-and-mortar stores as the "retail apocalypse" crushed other retailers over the past decade. They also shored up their defenses against Amazon and Walmart by targeting lower-income neighborhoods. 

As the U.S. teeters on the brink of a recession, Dollar General and Dollar Tree both look like solid defensive investments. But is one of these discount retailers a more compelling buy right now?

A person shops in a grocery store.

Image source: Getty Images.

The differences between these two stores

Dollar General isn't a true "dollar" store that sells everything for a dollar. Instead, it's a discount retailer that primarily targets rural areas that haven't been saturated by superstores.

Between the first quarters of fiscal 2017 and 2022, Dollar General expanded its total store count from 13,601 to 18,356 locations. Its annual revenue expanded at a compound annual growth rate (CAGR) of 9.2% from fiscal 2016 to 2021, and it experienced accelerating sales throughout the pandemic as more shoppers stocked up on household products.

Dollar General's gross margin increased from 30.8% in fiscal 2016 to 31.6% in fiscal 2021, even as it endured higher tariffs on Chinese products during the Trump Administration, and its earnings per share (EPS) grew at a CAGR of 18.1% throughout those five years.

Dollar Tree acquired its rival Family Dollar in 2015, and it mainly serves urban and suburban areas. Dollar Tree's namesake banner initially sold all of its products for $1, but raised its prices for the first time to $1.25 last year.

Family Dollar sells most of its products for less than $10. But over the past few years, Family Dollar added Dollar Tree sections to some of its locations, while converting others to Family Dollar and Dollar Tree "combo" stores. Between the first quarters of fiscal 2017 and 2022, the company expanded its combined store count from 14,482 to 16,162 locations.

Between fiscal 2016 and 2021, Dollar Tree's annual revenue increased at a CAGR of 4.9% as its EPS grew at a CAGR of 8.9%. However, its gross margin declined from 37.3% in 2016 to 29.4% in 2021 as it grappled with higher tariffs and sluggish sales at Family Dollar, which struggled a lot more against its discount competitors than its Dollar Tree stores.

Family Dollar also temporarily closed about 400 of its stores in the first quarter of fiscal 2022 to deal with product recalls related to a rodent infestation. Dollar General didn't suffer any comparable setbacks.

Investors are more bullish on Dollar General

Over the past five years, Dollar General's stock has rallied more than 230% as Dollar Tree's stock advanced nearly 120%. Dollar General attracted more bulls than Dollar Tree for four simple reasons: Its focus on rural areas exposed it to less competition, it was growing faster, its gross margins were expanding instead of contracting, and it wasn't burdened by a slow-growth banner like Family Dollar.

That trend could continue this year. For fiscal 2022, Dollar General expects its same-store sales to rise 3% to 3.5% and for its net sales to improve 10%-10.5% (including a two-percentage-point benefit from a 53rd week) as it opens 1,110 new stores. It expects its EPS to increase 12% to 14% (which also incudes a four-percentage-point benefit from the 53rd week).

Dollar Tree expects its same-store sales to rise by the mid-single digits in fiscal 2022, and for its net sales to grow 5.5%-7%. It didn't provide an exact target for its new store openings, but it expects its total selling square footage to increase by approximately 3.9% for the full year. It expects its EPS to grow 34% to 41% as it raises its prices and reins in its expenses.

The valuations and verdict

Dollar General trades at 20 times forward earnings and pays a forward dividend yield of nearly 1%. Dollar Tree trades at 19 times forward earnings and doesn't pay any dividends.

Dollar General and Dollar Tree should both be good stocks to own as inflation and rising rates rattle the markets. But if I had to choose one over the other, I'd still stick with Dollar General -- it clearly beats Dollar Tree across several key areas, trades at a comparable valuation, and pays a dividend.