The SpaceX founder says that he is working on getting people to Mars in order to start a colony.
He believes this will allow humans to survive if a third world war does break out amid growing tensions around the world.
Speaking at the South-by-Southwest (SXSW) tech conference, billionaire Mr Musk said: “We want to make sure that there’s enough of a seed of human civilisation somewhere else to bring civilisation back, and perhaps shorten the length of the Dark Ages.
“I think a moon base and a Mars base that could perhaps help regenerate life back here on earth would be really important.”
However, the South African-born entrepreneur says that nuclear weapons would not be the scariest thing about World War 3 – the biggest threat lies with artificial intelligence, says Mr Musk.
He continued: “I’m really quite close, very close to the cutting edge in AI. It scares the hell out of me.
“It’s capable of vastly more than almost anyone on Earth, and the rate of improvement is exponential.
“I think the danger of AI is much bigger than the danger of nuclear warheads by a lot.
“Nobody would suggest we allow the world to just build nuclear warheads if they want, that would be insane.
“And mark my words: AI is far more dangerous than nukes.”
Mr Musk told the conference that the first spaceships to Mars could be ready as early as next year, but they will not be carrying humans.
He said: “We are building the first Mars or interplanetary ship, and I think we’ll be able to do short flights, up and down flights, some time in the first half of next year.
“But sometimes my timelines are a little…you know.”