Expectations were high going into Amazon.com's (AMZN 1.49%) second-quarter financial report. With the stock already up 55% in 2018, there was little room for error. The company has made a habit of delivering on elevated expectations, and investors were hoping the days of heady growth could continue. True to form, Amazon absolutely crushed it yet again, driving the stock to new all-time highs.

Amazon reported revenue that grew to $52.9 billion, up 39% year over year, consistent with both analysts' consensus estimates for $53.44 billion, and management's own forecast of $52.5 billion at the midpoint of guidance. The company benefited from a foreign currency tailwind of about $760 million. In constant currency, net sales increased 37% compared to the year-ago quarter.

An overhead view of an Amazon Fulfillment Center with a solar panel array on the rooftop.

Image source: Amazon.

Amazon's second-quarter earnings: The raw numbers

Metric

Q2 2018

Q2 2017

Year-Over-Year Change

Revenue

$52.89 billion

$37.95 billion

39.3%

Operating income

$2.98 billion

$0.63 billion

375%

Net income

$2.53 billion

$0.20 billion

1,186%

Earnings per share

$5.07

$0.40

1,168%

Data source: Amazon's Second-Quarter Financial Report. Chart by author.

Operating income of $2.98 billion blasted past the company's forecast of $1.5 billion at the midpoint of its guidance range. Net income soared to $2.53 billion, up 1,186% compared to the prior-year quarter, producing earnings per share of $5.07, nearly doubling analysts' expectations for $2.54 per share.

Explosive growth as far as the eye can see

Each of Amazon's reporting segments impressed. Sales in the North America segment jumped 44% year over year to $32.2 billion, while international sales of $14.61 billion grew 27% compared to the prior-year quarter. The most remarkable results came from Amazon Web Services (AWS) as revenue from the company's cloud computing division soared an incredible 49% over the year-ago quarter, and accounted for 11.5% of Amazon's Q2 sales.

If the revenue growth numbers were impressive, the operating income metrics were astonishing.

Amazon Q2 Operating Income by Segment

Segment

Q2 2018

Q2 2017

Year-Over-Year Change

North America

$1.84 billion

$0.44 billion

321%

International

($0.49 billion)

($0.72 billion)

N/A

AWS

$1.64 billion

$0.92 billion

79%

Total

$2.53 billion

$0.20 billion

1,186%

Data source: Amazon's Second-Quarter Financial Report. Chart by author.

Amazon touched only briefly on its just-completed Prime Day in its press release, as the event was held during the third quarter. The company said it was "Amazon's biggest global shopping event ever, welcoming more new Prime members on July 16th than any other previous day in Amazon history." The company sold more than 100 million products, with the best-selling items being the Fire TV Stick with Alexa Voice Remote and the Echo Dot.

The biggest contributor to profitability

AWS has often been cited as the sole reason for Amazon's profitability. While that may have been true in the past, improving margins across the company's other segments are providing a significant boost to the bottom line. In fact, each segment achieved a year-over-year improvement in its operating margin last quarter.

In North America, segment margin expanded from 1.9% in the year-ago period to 5.7% last quarter. In its international markets, the company's operating loss margin improved from -6% to -3%. AWS also increased its contribution, with its segment margin increasing from 22.3% of sales to 26.9%. These improvements helped Amazon drop more profit to the bottom line.

Is there an Echo in here?

The comments in the press release from Amazon CEO Jeff Bezos focused on the growing ecosystem of Alexa-enabled products and services. "We want customers to be able to use Alexa wherever they are," Bezos said. "There are now tens of thousands of developers across more than 150 countries building new devices using the Alexa Voice Service, and the number of Alexa-enabled devices has more than tripled in the past year."

It's easy to understand why Bezos would want to shine a spotlight on the company's digital assistant. Research has shown that customers who interact with the devices powered by Alexa tend to significantly increase their spending on Amazon's website.

The future's so bright, I gotta wear shades

For the third quarter, Amazon is forecasting revenue in a range of $54 billion to $57.5 billion. This represents year-over-year growth of between 23% and 31%, which includes an unfavorable impact of 30 basis points from foreign exchange rates. The company expects to produce $1.4 billion to $2.4 billion of operating income, representing growth of between 303% and 592% compared to the prior-year quarter.

The analyst consensus calls for revenue of $57.2 billion -- up 31% year over year -- and earnings per share of $3.03, representing growth of nearly 500% compared to the prior-year quarter.

With solid revenue growth, expanding margins, and sterling profitability, Amazon gave investors everything they were looking for in its second-quarter earnings report.