The best type of stocks to own are those that can carry on compounding your wealth or dishing out rising dividends without you breaking a sweat. These businesses qualify to sit comfortably in your investment portfolio for years or even decades. While growth stocks may hog the limelight as investors chase capital gains, what many may not know is that boring but dependable stocks can still do extremely well in the long term as they deliver sustainable dividends amid a steadily rising stock price.

But which type of stocks qualify to be long-term winners that you can buy and hold forever? In my book, these businesses need to possess a strong competitive moat with a large and sticky customer base, display a solid track record of growing their revenue and profits, and pay out growing dividends to boot. Owning such stocks for the long term means you can not only grow your retirement fund but also generate an increasing stream of passive income to sustain your lifestyle.

Here are three stocks that are great candidates for you to own forever.

Grocery warehouse shopper.

Image source: Getty Images.

1. PepsiCo

PepsiCo (PEP -0.62%) is a huge food and beverage company that manufactures and sells beverages, snacks, and convenience foods under famous brands such as Pepsi-Cola, Lay's, Mountain Dew, and Quaker. Armed with a wide variety of products and recognizable brands, PepsiCo enjoys strong pricing power that can help it raise its selling prices to beat inflation. From 2020 to 2022, the company saw its net revenue rise from $70.3 billion to $86.4 billion, while net income increased from $7.1 billion to $8.9 billion over the same period. The business also generated an average positive free cash flow of $6.3 billion over these three years. 

PepsiCo's earnings momentum has carried on into 2023. Revenue in the first half of the year rose 10% year over year to $40.2 billion, with net income (after adjusting for impairments and one-off gains) climbing 18% year over year to $4.7 billion. The half-year also saw the beverage and snack company generate a positive free cash flow of $500 million. In tandem with the strong results, PepsiCo announced a 10% year-over-year increase in its quarterly dividend to $1.265 per share, representing the 51st consecutive year that the company has increased its annual dividend. Third-quarter results were solid as well, and investors can expect more increases in revenue, profits, and dividends in the years to come with PepsiCo's robust franchise that will keep customers coming back to purchase more.

2. Costco Wholesale

Costco Wholesale (COST 1.01%) is a warehouse membership retailer operating 861 warehouses worldwide that offer low prices for a wide selection of private-label products. This business model has made the company the third-largest global retailer, with 310,000 employees. The financial numbers show the effectiveness of Costco's modus operandi, with total revenue jumping from $166.8 billion to $227 billion from fiscal 2020 (ended Aug. 31) to fiscal 2022. Net income surged 46% over this period from $4 billion to end at $5.8 billion. The retailer was also highly cash-generative, with an average positive free cash flow of close to $5 billion per fiscal year. Around 81% of the company's warehouses are situated in the U.S. and China, which has seen a membership renewal rate of close to 93%. Costco boasts a membership base of almost 128 million people who paid a total of $4.6 billion in membership fees for the last 12 months. 

FY2023 saw the company report continued growth as its revenue rose 7% year over year to $242.3 billion, while net income improved by 7.7% year over year to $6.3 billion. Free cash flow soared by 93% year over year to $6.7 billion. Costco initiated its first dividend back in 2004 at $0.40 per share and has since grown this dividend to $4.08 per share for a compound annual growth rate (CAGR) of 13%. The retailer's strong performance and consistent free cash flow generation provide assurance that its dividend track record can continue. For fiscal year 2023, Costco opened 23 new warehouses and conducted three relocations. In the first quarter of fiscal year 2024, the company plans to open 10 new warehouses -- nine in the U.S. and one in Canada. These plans, along with Costco's robust business model, should ensure that the retailer can continue to steadily grow its revenue and net income for the foreseeable future.

3. WD-40

WD-40 (WDFC 0.14%) manufactures and sells a slate of maintenance and household cleaning products. Its flagship WD-40 multipurpose product has been likened to a "Swiss Army Knife" as it boasts multiple use cases. Anchored by its main product and supported by a portfolio of other home-care products, WD-40 has grown its sales from $408.5 million in fiscal year 2020 (ended Aug. 31) to $518.8 million in fiscal year 2022. Net income has risen in tandem, going from $60.7 million to $67.3 million. In the first nine months of fiscal year 2023, revenue inched up 2% year over year to $396.8 million, but net income slipped by around 6% year over year to $49.4 million on the back of higher selling and administrative expenses. Free cash flow, however, soared to $50.9 million from just $541,000 over the same period. 

WD-40 has also rewarded shareholders with rising dividends over the years. The quarterly dividend stood at $0.31 per share back in fiscal year 2013 but has risen to $0.83 per share in the latest fiscal year, for a CAGR of 10% over the last decade. Management has outlined several strategic initiatives in its growth plan as it estimates the global market opportunity for its WD-40 multipurpose product to be around $1 billion. Its objective is to also increase the share of premium product sales from the current 47% to its target of more than 60%, thus driving up gross margins over the long term. Yet another ambition is for the company to engage people through digital commerce so it can increase brand and product awareness and reach out to a wider base of potential customers. With a strong product portfolio and steady growth, WD-40 should enjoy decent pricing power that can help it preserve and improve its margins and pay out higher dividends over time.