Shareholders are probably tired of hearing it -- I'm a shareholder and I know I'm tired of it -- but it still needs to be said: Shares of connected-TV platform company Roku (ROKU -3.96%) are down almost 90% from highs reached back in 2021. The ride hasn't been fun in recent years and there are fundamental reasons the stock is down.

One of Roku's biggest problems is its gross profit -- how much it makes after taking out the direct costs of its products and services. The company's hardware devices (smart TVs and plug-in streaming devices) cost more to make than what it sells them for. Moreover, the gross profit margin for its operating-system software steadily declined in recent years.

Another problem for Roku is its operating expenses, which have steadily gone up. In the first quarter of 2024, the company had total operating expenses of $460 million, up 83% from its total operating expenses in the same quarter of 2021. By comparison, its total net revenue is only up 53% during this same time period.

In summary, Roku's gross profit margin is going down and its operating margin is also going down -- this is a really troubling combination and it's not surprising to see the stock down in the dumps.

However, investors may be shocked to see that Roku's free cash flow is at an all-time high.

ROKU Free Cash Flow Chart

ROKU Free Cash Flow data by YCharts

Because free cash flow is up and the stock price is down, Roku's price-to-free-cash-flow valuation is cheaper than it's ever been. And Roku stock isn't only cheaper than it's been in the past; its valuation of 20 times free cash flow is considered quite reasonable on an absolute basis as well.

Here's what investors should know about Roku's cash flow.

Roku's free-cash-flow surge explained

Some investors prefer to monitor a company's free cash flow over its net income because net income can include noncash accounting items. By contrast, free cash flow represents real money flowing in and out of the business.

Roku's free cash flow is hitting an all-time high even though I've explained long-term trends with deteriorating profit margins. The margins are down but revenue has continued to rise due to the company attracting new users and those users spending tons of time streaming video on the platform, increasing the number of ad impressions.

More importantly, Roku recently exercised some operational discipline. In Q1, the company's operating expenses were down 16% year over year -- this sharp reduction in spending helps boost cash flows.

However, Roku's management also liberally uses stock-based compensation -- in other words, its workforce earns shares of Roku as part of their pay packages. This is a noncash consideration, so it preserves cash flow. However, it's still an expense, so it still impacts net income -- that's why there's such a disparity in Roku's case.

ROKU Stock Based Compensation (TTM) Chart

ROKU Stock Based Compensation (TTM) data by YCharts

I wouldn't say that Roku's use of stock-based compensation is necessarily good or bad -- it just is. And investors need to be aware of it.

To summarize, Roku's revenue is rising. And even though certain profit margins are contracting, which is troubling, its free cash flow is rising as the company reins in spending to a degree. So while there are legitimate concerns, there's also reason for optimism.

What's next for Roku?

The real question is whether Roku's free cash flow can go higher still. And I believe there's reason to think it can.

In the first quarter, Roku's average revenue per user (ARPU) was virtually unchanged from the prior-year period. But streaming hours per user were up. This indicates that advertisers aren't paying as much for slots in Roku's system. But I believe this issue is temporary.

I believe it's temporary because Roku's capabilities are clearly improving. It has partnerships with retailers that can directly correlate advertising with purchases. And some Roku ads are shoppable with a click of the remote, reducing friction. It could be only a matter of time before advertisers start paying up for a chance to get in front of Roku's audience of 82 million households.

If bidding for Roku's ad slots gets more competitive, as I believe it could, then Roku will be generating more revenue from the same amount of business. This would be a tremendous boost for revenue and profits. And the company's free cash flow could consequently soar to new heights.

It's not a guaranteed outcome for shareholders and Roku has plenty of work ahead. But it's certainly a possible outcome with potentially big implications for the stock price, which is why I'm still holding Roku stock for now.