While merely investing $8 a week in the S&P 500 Index may not sound like enough to set you on a path to retirement, this $400 added annually could balloon to nearly $200,000 after 40 years, assuming the market's standard 10% returns.

Furthermore, finding stocks with specific indicators such as well-known brands, growing and sustainable dividends, and a top-tier return on invested capital can boost these historical returns closer to the 12% mark. This slightly higher rate would turn these weekly $8 additions into $344,000 over the same time.

Best yet for investors, companies that offer these market-beating traits can be found all around us. Starbucks (SBUX -0.35%) and The Hershey Company (HSY 2.31%) are two great examples hiding in plain sight. Here's what makes these two juggernauts the smartest dividend stocks to buy with $400.

Three Starbucks drinks sit on a white marble countertop, casting a shadow.

Image source: Getty Images.

Starbucks' numerous market-beating indicators

Home to over 38,000 stores globally -- half of them franchised and half company-owned -- it may seem like there aren't many chapters left in Starbucks' growth story. However, with sales growing by 8% in the first quarter and management guiding for 4% store count growth over the long term, Starbucks' maturing operations shouldn't be avoided by investors.

Led by its immense brand power, which Kantar Brandz ranks higher than Walt Disney, Walmart, and TikTok, the company grew its rewards membership by 13% to 34.3 million people in Q1. This ranking is worth noting since companies on Kantar Brandz's Top 100 Most Valuable Global Brands list have outperformed the S&P 500 by two percentage points annually since 2006.

On top of this, Statista recently showed that Starbucks remained the favorite coffee brand among Gen Z and Millennials, highlighting that this popularity could continue for decades.

Powered by this loyal fan base of 34 million members, the company generates a return on invested capital (ROIC) of 63%. Measuring Starbucks' profitability compared to its debt and equity, this high ROIC shows that the company is masterful at using its capital to expand globally. As this article shows, companies with a ROIC in the top two quintiles of the Motley Fool Investable Stock Universe -- like Starbucks -- have proven to be an outperforming proposition over the long term.

Despite this impressive profitability, the company's ties to China -- which accounts for 17% of its store locations -- continue to pose a geopolitical risk, serving as one of the catalysts for Starbucks' recent share price struggles. However, the negative sentiment toward the company may be overdone, as it trades at one of its most attractive valuations of the last decade.

SBUX Earnings Yield Chart

SBUX Earnings Yield data by YCharts

Starbucks stocks pays a 2.4% dividend yield that is near decades-long highs yet well below its 4.1% earnings yield. Investors should expect Starbucks' 13-year streak of dividend increases to continue far into the future. Though sales growth has slowed, these well-funded and growing dividends, the company's declining share count, industry-leading brand, and top-tier ROIC combine to make Starbucks an excellent candidate for investors to buy with $400.

Person eating a chocolate bar while standing in front of a white backdrop.

Image source: Getty Images.

Hershey continues battling through a brutal environment

Guiding for sales growth of 2% to 3% and flat earnings-per-share (EPS) growth in 2024, Hershey continued its recent run of disappointing the market. With the shares down 30% from their all-time highs, the company has a litany of headwinds facing its operations. The first and most immediate issue is skyrocketing cocoa and sugar prices, which have risen 153% and 58% since 2019, respectively.

Cocoa Price Chart

Cocoa and Sugar Price data by YCharts

Due to heavy rain in West Africa, cocoa prices have spiked over 120% in the last 15 months alone. Considering this dramatic increase in the cost of its core ingredients, Hershey's flat EPS projection for 2024 seems rather promising -- especially after growing profits by 14% last year.

Adding to these pricing difficulties, the company recently launched new capacity expansion projects alongside implementing a new enterprise resource planning system, boosting its capital expenditures (CapEx) to a level it hasn't seen this century.

HSY CAPEX To Revenue (TTM) Chart

HSY CAPEX To Revenue (TTM) data by YCharts

Despite these challenges, Hershey's has maintained a net profit margin of 17% and an ROIC of 22%. This incredible feat may indicate a wide moat surrounding the company's operations, as it has thus far been able to pass along the majority of these higher expenses to customers without losing their faith. According to a Statista brand awareness study, the company's Reese's, Hershey's, and Kit Kat labels all ranked among the top five most recognizable candy brands in the U.S. in 2023.

Driven by Hershey's brand power and persistent profitability in the face of significant headwinds, investors can reasonably imagine the company extending its 14-year dividend increase streak. Paying a 2.5% yield that only uses 48% of the company's net profits, Hershey raised its dividend by 15% in 2023.

Trading at a reasonable 21 times earnings, Hershey is home to a long list of market-beating indicators, much like its consumer goods peer, Starbucks. These indicators, paired with an eventual reduction in ingredient prices and CapEx spending, make Hershey one of my favorite dividend stocks to add to my daughter's portfolio today.