Vertex Pharmaceuticals (VRTX -0.06%) has been one of the fastest-growing healthcare companies in recent years. Its products have made it a leader in cystic fibrosis (CF) treatment and it has been expanding into other areas as well.

How much of a return would you have earned on a $10,000 investment in the stock made five years ago, and how does that compare with how the markets have done? Let's have a closer look at both the business and the stock.

How Vertex's stock has performed over the past five years

On the last trading day of 2018, Vertex's stock closed at a price of $165.71. If you invested $10,000 into the healthcare stock at the time, you would have acquired just over 60 shares of the company.

While it hasn't always been a smooth ride for Vertex, over the past five years the stock has been on a fairly strong trajectory. At a share price of around $430, the value of those 60 shares would be worth approximately $26,200 today. Your total return would be around 160%. By comparison, if you invested in the S&P 500, then the same size investment would be worth $20,800 today, for a return of 108%.

Vertex has dwarfed the market over the past five years. And when looking at its financial performance and overall growth, it's easy to see why this has been an exceptional, market-beating stock.

Vertex's business has taken off

In the trailing 12 months, Vertex's revenue has totaled $9.7 billion. Earnings during that time totaled $3.5 billion, for an impressive profit margin of 36%. Not only are its margins great, but both Vertex's top and bottom lines have been experiencing significant growth in the past five years.

VRTX Revenue (TTM) Chart

VRTX Revenue (TTM) data by YCharts

The big catalyst for the business since then has been Trikafta, which is sold under the name Kaftrio in Europe. The Food and Drug Administration granted approval for the treatment in October 2019, making it available to nearly all (90%) of patients with CF, as it targets the most common mutation.

During just the first nine months of 2023, Trikafta/Kaftrio has generated more than $6.6 billion in revenue -- that's more than double the $3 billion in sales all of Vertex's CF products brought in for a full year in 2018. Trikafta/Kaftrio has been nothing short of a game changer for Vertex Pharmaceuticals, giving the company's financials a massive boost.

The future remains bright for Vertex

Vertex's CF franchise has been so strong that the question inevitably leads to whether it's too dependent on CF, and whether it is diverse enough. But there's no reason to be worried about its growth just yet.

In December, regulators approved Casgevy, a gene therapy Vertex has been developing with CRISPR Therapeutics as a treatment for sickle cell disease. And this month, they also approved it for transfusion-dependent beta thalassemia. The company will share in the profits on Casgevy with CRISPR (Vertex will take a 60% cut).

In addition, Vertex has a couple of late-stage trials ongoing, including Inaxaplin, which is a treatment for APOL1-mediated kidney disease, and VX-548, a promising non-opioid pain medication.

Overall, there's reason for investors to remain bullish on the company's growth prospects. Vertex isn't running out of growth opportunities. And if it can maintain its high profit margins, its bottom line should also continue to soar.

Is Vertex Pharmaceuticals still a good buy?

Vertex has been one of the hottest healthcare stocks to own over the past five years. And although it has achieved a significant run up in value during that time, now being worth around $110 billion, it still may not be that expensive. At 27 times its estimated future earnings, the stock isn't trading at a huge premium. And with more growth on the horizon, its valuation could be justifiable.

For investors who want a top growth stock to add to their portfolio, Vertex could be a great option. Fantastic margins, a solid CF franchise, the recent approval of Casgevy, and more products still in its pipeline make this an easy investment to get excited about.