The S&P 500 eked out a slim gain on Tuesday after strength in some big technology stocks countered disappointing quarterly reports from Johnson & Johnson and Goldman Sachs as first-quarter earnings season kicked into gear.

The Dow and Nasdaq ended with fractional declines on the day.

J&J shares fell 2.8% after the healthcare conglomerate cautioned investors over the lingering impact of inflation-driven costs this year. Goldman shares dropped 1.7% after the Wall Street firm's profit fell 19% as dealmaking and bond trading slumped.

The early quarterly results from S&P 500 companies come as investors have been bracing for a gloomy reporting season, fearing the economy may be on the cusp of a downturn.

"What we are seeing here is the calm before the storm as far as earnings go," said Brad McMillan, chief investment officer of Commonwealth Financial Network. "The market is just trying to see, do we have some upside here or not, and I think it is really going to come down to earnings over the next couple of weeks."

The Dow Jones Industrial Average fell 10.55 points, or 0.03%, to 33,976.63, the S&P 500 gained 3.55 points, or 0.09%, to 4,154.87 and the Nasdaq Composite dropped 4.31 points, or 0.04%, to 12,153.41.

The CBOE Volatility index, also known as Wall Street's fear gauge, fell to its lowest point since January 2022 during the session.

The heavyweight technology sector rose 0.4%, helped by a 2.5% increase in shares of Nvidia Corp after HSBC raised its recommendation on the graphics chipmaker to "buy" from "reduce."

The healthcare sector dropped 0.7%, weighed down by J&J shares.

S&P 500 company earnings are expected to have declined 4.8% in the first quarter from a year earlier, according to Refinitiv IBES data as of Friday. Investors have zeroed in on bank results after the failure of Silicon Valley Bank last month set off concerns about potential systemic risks.

"While the big money center banks did very well as a whole, the focus I think is going to be on the regional banks because that is really where the center of the fallout was," said Paul Nolte, senior wealth advisor and market strategist at Murphy & Sylvest Wealth Management.

Shares of Netflix Inc fell in initial after-hours trading on Tuesday following the company's quarterly report.

The S&P 500 is trading near two-month highs as investors await a deluge of earnings and assess the interest rate path ahead of an expected 25 basis point increase at the Federal Reserve's meeting early next month.

St. Louis Federal Reserve President James Bullard told Reuters on Tuesday the U.S. central bank should continue raising rates on the back of recent data showing persistent inflation. Separately, Atlanta Fed President Raphael Bostic said the Fed most likely has one more rate hike ahead.

In other earnings news, Lockheed Martin Corp's shares rose 2.4% after the U.S. weapons maker's first-quarter results surpassed Wall Street targets despite parts and labor shortages.

Advancing issues outnumbered decliners on the NYSE by a 1.01-to-1 ratio; on Nasdaq, a 1.29-to-1 ratio favored decliners.

The S&P 500 posted 28 new 52-week highs and no new lows; the Nasdaq Composite recorded 66 new highs and 143 new lows.

About 9.8 billion shares changed hands in U.S. exchanges, compared with the 10.7 billion daily average over the last 20 sessions.

(Reporting by Lewis Krauskopf in New York, Sruthi Shankar, Ankika Biswas and Vansh Agarwal in Bengaluru; Editing by Sriraj Kalluvila, Vinay Dwivedi and Richard Chang)