Qualifying at Sepang International Circuit was delayed more than 50 minutes due to a torrential downpour.
Hamilton claimed his second pole position in as many grand prix this season with a lap in 1 minute, 59.431 seconds. His 33rd career Formula One pole placed him in a tie with Jim Clark for most pole wins among British drivers in the history of the sport.
Two weeks ago, Hamilton started on pole for the Australian Grand Prix but suffered engine failure on the opening lap, which forced him to retire. Hamilton has yet to win the Malaysian GP. He finished third after starting on pole in this event in 2012.
Vettel, the four-time defending F1 world champion, has rebounded nicely from the Australian GP with a second-place finish in qualifying. His lap was just 0.055 seconds behind Hamilton. Vettel qualified 13th in Australia. He also retired early in that race when his power unit failed.
During the first round in qualifying here in Malaysia, Vettel experienced an energy store problem. His Red Bull team was able to correct the problem and quickly put him back on track.
Vettel has won three of the last four Malaysian GPs, including a victory in this race one year ago.
Hamilton's teammate, Nico Rosberg, qualified third. Rosberg won the Australian GP.
Fernando Alonso from Ferrari rebounded from an incident with Toro Rosso's Daniil Kvyat to finish fourth in qualifying. Both drivers made contact late in Q1 when Kvyat, a rookie this season, locked up and slid into Alonso, who sustained slight damage to his front right suspension. Ferrari made expeditious repairs to his car.
Daniel Ricciardo from Red Bull qualified fifth, followed by Ferrari's Kim Raikkonen and Nico Hulkenberg from Force India. McLaren's Kevin Magnussen, fresh off a second-place finish in Australia, will start eighth in the Malaysian GP.