He beat Jeremy Hunt comfortably, winning 92,153 votes to his rival's 46,656.
The former London mayor takes over from Theresa May on Wednesday.
In his victory speech, Mr Johnson promised he would "deliver Brexit, unite the country and defeat Jeremy Corbyn".
Speaking at the Queen Elizabeth II centre in London, he said: "We are going to energise the country.
"We are going to get Brexit done on 31 October and take advantage of all the opportunities it will bring with a new spirit of can do.
"We are once again going to believe in ourselves, and like some slumbering giant we are going to rise and ping off the guy ropes of self doubt and negativity."
Mr Johnson thanked his predecessor, saying it had been "a privilege to serve in her cabinet". He was Mrs May's foreign secretary until resigning over Brexit.
The outgoing PM - who is standing down after a revolt by Conservative MPs over her Brexit policy - congratulated her successor, promising him her "full support from the backbenches".