Revenue for the fourth quarter of 2017 was $166.6 million, compared to $346.6 million in the fourth quarter of 2016. Net loss for the fourth quarter of 2017 was $97.5 million, or $2.42 per diluted share, compared to net income of $51.8 million, or $1.27 per diluted share in the fourth quarter of 2016. Non-GAAP net income was $9.2 million, or $0.22 per diluted share for the fourth quarter of 2017, compared to non-GAAP net income of $56.3 million, or $1.38 per diluted share for the same period in 2016.
The company's GAAP Net Loss for the fourth quarter and year ended December 31, 2017 was significantly impacted by both the enactment of the Tax Cuts and Jobs Act of 2017 and by its decision to record a valuation allowance against all of its U.S. deferred tax assets. The combined GAAP impact totaled $103 million. These items have been excluded for non-GAAP purposes.
For 2017, overall gross profit margin on a GAAP and non-GAAP basis was 33% and 34%, respectively, compared to 35% on a GAAP and non-GAAP basis for 2016.
Operating expenses for 2017 were $196.4 million, compared to $211.1 million in 2016. Non-GAAP operating expenses for 2017 were $176.5 million, compared to $199.7 million in 2016. GAAP operating expenses in 2017 included $8.6 million in restructuring charges associated with our recent workforce reduction.
As of December 31, 2017, cash, investments and restricted cash totaled $147 million. Working capital at the end of the fourth quarter was $354 million, compared to $373 million at December 31, 2016.
"Despite difficult conditions in our core market we finished 2017 strong, highlighted by several large acceptances at multiple sites around the world, including completing the installation of what is now the largest supercomputing complex in India at the Ministry of Earth Sciences", stated Peter Ungaro, president and CEO of Cray. "As we shift to 2018, we're seeing signs of a rebound at the high-end of supercomputing as well as considerable growth opportunities in the coming years. Supercomputing continues to expand in importance to both government and commercial customers, driving growth and competitiveness across many different disciplines and industries. As the leader at the high-end of the market, we're poised to play a key role in this growth and I'm excited about where we're headed."
For 2018, while a wide range of results remains possible, Cray continues to expect revenue to grow in the range of 10-15% over 2017. Revenue is expected to be about $50 million for the first quarter of 2018. For 2018, GAAP and non-GAAP gross margins are expected to be in the low- to mid-30% range. Non-GAAP operating expenses for 2018 are expected to be in the range of $190 million. For 2018, non-GAAP adjustments are expected to total about $14 million, driven primarily by share-based compensation. For the year, GAAP operating expenses are anticipated to be about $12 million higher than non-GAAP operating expenses, and GAAP gross profit is expected to be about $2 million lower than non-GAAP gross profit.
Based on this outlook, Cray's effective GAAP and non-GAAP tax rates for 2018 are both expected to be in the low-single digit range, on a percentage basis.
Actual results for any future periods are subject to large fluctuations given the nature of Cray's business.
Recent highlights include the following: