John Terry’s own goal from Neil Taylor’s left-wing cross gave previously unbeaten Swansea an 11th-minute lead at Stamford Bridge, but Costa equalised on the stroke of half-time with a header from a right-wing corner.
The former Atletico Madrid striker made it 2-0 in the 56th minute, lifting a shot into the roof of the net after Cesc Fabregas had exchanged passes with Eden Hazard and cut the ball back from the byline.
Costa completed his treble in the 67th minute by sweeping home a mishit shot by Ramires, before Oscar teed up substitute Loic Remy to claim a debut goal. Jonjo Shelvey scored a late consolation goal for Swansea.
Brazil-born Spain international Costa now has seven goals to his name and is the first player to score in his first four Premier League games since Coventry City’s Micky Quinn in 1992.
“Diego Costa is one of the best strikers we have at this moment in football,” said Chelsea manager Jose Mourinho.
“The team is an attacking team that creates a lot and creates spaces for a striker. It could have been five or six.”
Earlier, Martin Demichelis scored an 83rd-minute equaliser as champions Manchester City held Arsenal to a 2-2 draw in an entertaining encounter at the Emirates Stadium.
Arsenal looked set for victory when Alexis Sanchez slammed home a sumptuous volley in the 74th minute, after Jack Wilshere’s neatly constructed goal had cancelled out Sergio Aguero’s first-half opener for City.
But Argentina centre-back Demichelis headed in an Aleksandar Kolarov corner to prevent Manuel Pellegrini’s side from slumping to a second consecutive defeat after their shock 1-0 loss at home to Stoke City.
“I think it was a great game: two very good teams, who try to play. Both teams are very creative,” City manager Pellegrini told BT Sport.
“But both goals by Arsenal were very clear fouls: the first one, two or three continuous fouls, and the second one, (Danny) Welbeck on Vincent (Kompany).”
– Leicester claim first win –
Arsenal manager Arsene Wenger drew encouragement from the way his side came from behind to lead, but he was also given serious cause for concern by an ankle injury to right-back Mathieu Debuchy.
“It was a game of top quality and we did remarkably well to come back, but then we gave a cheap goal away,” said Wenger, who handed a debut to former Manchester United striker Danny Welbeck.
“Debuchy has a bad ankle sprain. I don’t know how long he will be out for, but it doesn’t look too good.”
Liverpool host Aston Villa later on Saturday, when Mario Balotelli is in line to make his home debut.
Elsewhere, Everton claimed their first win of the season with a 2-0 success at West Bromwich Albion.
Romelu Lukaku opened the scoring in the second minute against his former club, pouncing on a loose clearance from Jonas Olsson and curling home, with Kevin Mirallas sealing victory in the 67th minute.
An own goal by Harry Kane saw Tottenham Hotspur held to a 2-2 draw at Sunderland.
After Nacer Chadli and Adam Johnson had exchanged quick-fire goals, Chadli teed up Christian Eriksen to restore Spurs’ lead, only for Vlad Chiriches’s clearance to hit Kane and bounce in for an own goal in the 82nd minute.
Graziano Pelle scored twice as Southampton sent Newcastle United to the foot of the table with a 4-0 win at St Mary’s. Jack Cork and Morgan Schneiderlin were also on target.
Leicester City secured their first victory since gaining promotion thanks to a second-half effort from new signing Leonardo Ulloa in a 1-0 win at Stoke.
But fellow promoted side Burnley failed to follow suit, with Scott Arfield seeing a late penalty saved by Julian Speroni in a 0-0 draw at Crystal Palace.
Manchester United host Queens Park Rangers on Sunday, when Radamel Falcao, Luke Shaw, Marcos Rojo and Daley Blind are all in line to make their first appearances for Louis van Gaal’s side.