It seems like every year, there is some news article about how Airbnb (ABNB 0.75%) is on the brink of collapse. First, it was how the COVID-19 pandemic would end Airbnb, then it was that inflation would cause travel to cease, and this year it was that Airbnb's revenue was collapsing in key cities. Each time has proven to be false, but the stock has traded like many of these concerns were true.

With all this pessimism surrounding Airbnb, is it worth an investment today?

Airbnb delivered an outstanding Q2

Airbnb is the market leader in alternative stays and experiences. Whether you're looking for an entire house to stay in for a weekend, a spare bedroom to rent for a month on a business trip, or a guided hike, Airbnb has you covered. While Airbnb has grown significantly since its founding in 2008, it still has room to expand.

In the second quarter, nights and experiences booked rose 11% year over year, with gross booking value (GBV) up 13% to $19.1 billion. This flies in the face of the recent report by Alltherooms that revenue was collapsing in a few key cities.

But even though GBV was up in the low teens, revenue rose at a much faster 18% clip to $2.5 billion. Airbnb's ability to grow revenue quickly shows it can exercise strong pricing power on its hosts, which will become invaluable as the company matures.

Perhaps the most impressive item with Airbnb over the past two years has been its rise in profitability. With a net income margin of 26%, Airbnb recorded the second-most profitable quarter on record in Q2. Airbnb has become a profit-generating machine, and that's great news for investors.

Furthermore, the third quarter is also expected to be decent, with 16% revenue growth projected at the midpoint. Despite what many doomsayers have been thinking, Airbnb is still executing at high levels, but is the stock in a range where investors should consider buying?

Airbnb's margins are strong

Now that Airbnb has been fully profitable for one year, we can utilize its price-to-earnings metric to assess its valuation. At nearly 40 times earnings, Airbnb's stock is far from cheap.

ABNB PE Ratio Chart

ABNB PE Ratio data by YCharts

Even if forward growth is factored into the calculation, 33 times forward earnings isn't cheap either. So why does Airbnb trade at this premium?

It all comes down to margins. Airbnb's margins aren't like a typical travel company's; they are more like a software company's. Just look at Airbnb's margins compared to software giant Adobe versus hotel chains like Hyatt Hotels and Marriott International.

ABNB Profit Margin Chart

ABNB Profit Margin data by YCharts

Given its much higher margins, it's clear that Airbnb deserves to trade like a software company, rather than a travel company, with one caveat: recessions. At some point in time, a recession will strike the U.S. and will likely cause Airbnb to lose some business temporarily. A software company like Adobe operates on a subscription model, which will keep revenue coming in (but maybe not growing).

As a result, Airbnb likely deserves to trade slightly lower than software stocks, but only marginally so.

So is Airbnb a buy today at 40 times earnings? I'd say yes. This company is improving its profitability quarter after quarter, so its margins still have room for expansion. While this isn't a slam dunk, investors should see this as a place to buy the stock to track it and learn more about it. Eventually, Airbnb's stock will look cheap again; but it's reasonably priced right now, so there's no reason to hold off on this stock.