Despite falling behind to Wilfried Bony, the hosts rallied through their impressive strikers, with the England man scoring twice before Swans keeper Lukasz Fabianski was sent off
Though the Hammers enjoyed the majority of possession throughout, Wilfried Bony punished them on the visitors' first attack of the game nearly 20 minutes in when he coolly finished a fine break, Jefferson Montero pulling back for the assist.
But Carroll got one back not long before the break when his fantastic looping header gave Lukasz Fabianski no chance.
The Swans were then undone in a flurry of action in the second half. First Carroll imperiously headed in a second when allowed space to attack a corner before Fabianski was sent off for rushing out to deny Diafra Sakho a goalscoring opportunity, despite the striker emerging from the challenge to hit the post.
Sakho later hit the post once again before finally getting on the scoresheet by driving through three defenders in the 87th minute and firing past a helpless Tremmel.
|VIEW FROM UPTON PARK
|By Harry Sherlock
If this was the battle of Andy Carroll and Wilfried Bony then there was only one winner, with the England striker turning in a virtuoso performance at Upton Park. When he is on form there are few other strikers in the league who can do what he does as well as he does and Swansea City found that out to their cost as he scored twice and provided a brilliant assist late on. It would be unfair to simply praise Carroll, however, with Diafra Sakho, Alex Song and Stewart Downing also superb.
Swansea, however, were blunt following Bony's opener, as they seemed content to simply sit on their 1-0 lead, and rarely tested Adrian in the second half. A West Ham fan passing the press box at full-time screamed 'We're going to win the league' and, while that may be far-fetched, there is a real belief bubbling in east London that the club can maintain their top-four tilt.
If they carry on playing like this, they may just be booking the tickets for a European tour in 2015-16.
Fabianski saved well with his legs from Kevin Nolan, who failed to connect properly with an earlier chance, and the visitors made the most of those let-offs when scoring with their first real attack.
Montero played a neat one-two with Gylfi Sigurdsson before pulling back for Bony to produce a clinical side-footed finish after 19 minutes.
Ashley Williams bravely blocked a Valencia effort following a nod down from Carroll, while Sigurdsson tested Adrian with a stinging drive at the other end.
Bony was inches wide with a rasping strike from 20 yards out before West Ham enjoyed a period of sustained pressure which ended with Carroll spectacularly heading in a Jenkinson cross with four minutes of the half remaining.
The hosts began the second period by bringing on Sakho to replace Valencia, with the Senegalese striker returning from a month out with a back injury.
However, it was the Welsh side who had the first big chance after the break when Bony struck the bar from long range on the counterattack with an hour gone.
Angel Rangel had to be alert to clear a Sakho cross away from goal but it proved only a brief respite as Carroll rose highest to head in a Stewart Downing corner after 66 minutes.
Sakho then hit the post after latching onto a through-ball and rounding Fabianski, who was then sent off by Chris Foy for impeding the striker after the referee had initially played the advantage.
West Ham should have increased their lead when Sakho was left one-on-one with substitute keeper Gerhard Tremmel but he shot against the base of the post.
Sakho made amends for that miss, though, when Carroll headed on a long ball and he powered through to fire over Tremmel with three minutes remaining.
Carroll's hat-trick attempt was cleared off the line and Tremmel saved well from Sakho as West Ham finished with a flourish.