On June 28, 1971, Elon Musk was born in Pretoria, Transvaal, South Africa. The son of Maye Musk, a Canadian model and dietitian born in Saskatchewan, Canada, and raised in South Africa, and Errol Musk, a South African electromechanical engineer, pilot, and sailor.

In 1980, Elon Musk's parents got divorced.

Musk was severely bullied throughout his childhood and was once hospitalized after a group of boys threw him down a staircase. He attended Waterkloof House Preparatory School and Bryanston High School before graduating from Pretoria Boys High School.

After his parents' divorce, Musk lived mostly with his father in the suburbs of Pretoria, a choice he made two years after his parents separated but which he subsequently regretted. Musk is estranged from his father, whom he has referred to as a terrible human being. He also has a half-sister and a half-brother.

Although Musk's father insisted that Elon go to college in Pretoria, Musk became determined to move to the United States, saying "I remember thinking and seeing that America is where great things are possible, more than any other country in the world." Musk knew it would be easier to get to the United States from Canada and moved there against his father's wishes in June 1989, just before his 18th birthday, after obtaining a Canadian passport through his Canadian-born mother.

While awaiting Canadian documentation, Musk didn't waste time, he attended the University of Pretoria for five months.

In 1989, Elon musk went to Canada where he started his path entering Queen's University, avoiding mandatory service in the South African military.

In 1992, Elon Musk left Queen's University to study economics and physics at the University of Pennsylvania.

In 1994, Elon Musk held two internships in Silicon Valley during the summer, at an energy storage start-up called Pinnacle Research Institute, which researched electrolytic ultracapacitors for energy storage, and at the Palo Alto-based start-up Rocket Science Games. Bruce Leak, the former lead engineer behind Apple's QuickTime who had hired Musk, said that Musk had boundless energy.

In 1995, Musk was accepted to a Ph.D. program in energy physics or materials science at Stanford University in California.

After only two days of enrolment in Ph.D., Elon Musk couldn't ignore opportunities in the Internet boom. So, He dropped out of his Ph.D. and he decided instead to launch his first company on the internet.

In 1995, Musk and his brother, Kimbal, started Zip2, a web software company, with money raised from a small group of angel investors, an individual who provides capital for a business start-up in exchange convertible debt or ownership equity. With the vector graphics mapping and direction coded by Musk in Java, the company aimed to develop and market an Internet city guide for the newspaper publishing industry, with maps, directions, and yellow pages. Musk obtained contracts with The New York Times and the Chicago Tribune and persuaded the board of directors to abandon plans for a merger with CitySearch. Musk's attempts to become CEO were thwarted by the board.

In 1997, Elon Musk graduated with a Bachelor of Arts degree in economics from Wharton and a Bachelor of Science degree in physics from the College of Arts and Sciences.

In February 1999, Compay acquired Zip2 for US$307 million in cash. Musk received US$22 million for his 7 percent share from the sale of the company.

In March 1999, Musk co-founded X.com, online financial services, and e-mail payment company, with US$10 million from the sale of Zip2.

In March 2000, X.com merged with Confinity, which had a money-transfer service called PayPal. The merged company was named X.com. However, the company focused on the PayPal service and was renamed PayPal in 2001.

Musk met his first wife, Canadian author Justine Wilson, while both were students at Ontario's Queen's University. They married in 2000.

Musk was ousted in October 2000 from his role as CEO, although he remained on the board, due to disagreements with other company executives over his desire to move PayPal's Unix-based infrastructure to a Microsoft one.

Musk believed that for humanity to survive we have to become a multiplanet species. So, in 2001, he conceived Mars Oasis, an idea to land a miniature experimental greenhouse on Mars, containing food crops growing on Martian regolith, in an attempt to reawaken public interest in space exploration.

In October 2001, Musk traveled to Moscow with Jim Cantrell, an aerospace supplies fixer, and Adeo Ressi, his best friend from college, to buy refurbished Dnepr Intercontinental ballistic missiles, a guided ballistic missile primarily designed for nuclear weapons delivery but converted for space utilization, where it could send the envisioned payloads into space. The group met with companies such as NPO Lavochkin and Kosmotras. However, according to Cantrell, Musk was seen as a novice and was consequently spat on by one of the Russian chief designers. The group returned to the United States empty-handed.

In February 2002, the group returned to Russia to look for three ICBMs, bringing along Mike Griffin. Griffin had worked for the CIA's venture capital arm, In-Q-Tel, as well as NASA's Jet Propulsion Laboratory, and was just leaving Orbital Sciences, a maker of satellites and spacecraft. The group had another meeting with Kosmotras and was offered one rocket for US$8 million. Musk considered the price too high and stormed out of the meeting.

On the flight back from Moscow, Elon Musk thought of launching a company that can build the rockets he needs at affordable prices. He calculated that the raw materials for building a rocket were only 3 percent of the sales price of a rocket at the time. It was concluded that the company could cut launch price by a factor of ten and still enjoy a 70-percent gross margin.

In May 2002, Musk founded Space Exploration Technologies Corp., traded as SpaceX, with US$100 million of his early fortune.

In October 2002, PayPal was acquired by eBay for US$1.5 billion in stock, of which Musk received US$165 million. Before its sale, Musk, who was the company's largest shareholder, owned 11.7% of PayPal's shares.

Elon Musk was always keen on the possibilities of electric cars. So, in February 2004, he became one of the major funders of Tesla Motors, later renamed Tesla, Musk led the Series A round of investment, joining Tesla's board of directors as its chairman.

Iterated by Musk in 2006, Tesla's plan was to build sports cars. Use that money to build an affordable car. Use that money to build an even more affordable car. While doing that, also provide zero-emission electric power generation options.

Musk provided the initial concept and financial capital for SolarCity, which was then co-founded in 2006 by his cousins Lyndon and Peter Rive.

In 2006, Musk was a member of the United States National Academy of Sciences Aeronautics and Space Engineering Board.

Following the financial crisis in 2008 and after a series of escalating conflicts in 2007, Eberhard was ousted from the firm. Musk assumed leadership of the company as CEO and product architect in 2008.

Together, Musk and his wife Justine had their first son, Nevada Alexander Musk, who died of sudden infant death syndrome (SIDS) at the age of 10 weeks. They later had five sons through in vitro fertilization, twins in 2004 (Griffin and Xavier), followed by triplets in 2006 (Kai, Saxon, and Damian). After their divorce in 2008, They shared custody of all five sons.

In 2008, Musk began dating English actress Talulah Riley, and in 2010, the couple married at Dornoch cathedral.

In February 2011, Forbes listed Musk as one of "America's 20 Most Powerful CEOs 40 And Under".

Musk believed that living on multiple planets may serve as a hedge against threats to the survival of the human species. Space X's goal is to reduce the cost of human spaceflight by a factor of 10. In a 2011 interview, Elon Musk said he hopes to send humans to Mars' surface within 10–20 years.

In May 2013 interview with All Things Digital, Musk said that to overcome the range limitations of electric cars, Tesla planned to expand its network of supercharger stations, tripling the number on the East and West coasts of the U.S. that June, with plans for more expansion across North America, including Canada, throughout the year.

On 12 August 2013, Musk unveiled a concept for a very high-speed transportation system, named Hyperloop, incorporating reduced-pressure tubes in which pressurized capsules ride on an air cushion driven by linear induction motors and air compressors. Where such a transport system might be built between the Greater Los Angeles Area and the San Francisco Bay Area.

On 12 August 2013, Musk unveiled a concept for a high-speed transportation system, called Hyperloop, incorporating reduced-pressure tubes in which pressurized capsules ride on an air cushion driven by linear induction motors and air compressors. where such a transport system might be built between the Greater Los Angeles Area and the San Francisco Bay Area.

On 17 June 2014, Musk committed to building a SolarCity advanced production facility in Buffalo, New York, that would triple the size of the largest solar plant in the United States and it will be followed by one or more even bigger facilities in subsequent years. The Tesla Gigafactory 2 is a photovoltaic (PV) cell factory, leased by Tesla subsidiary SolarCity in Buffalo, New York.

In 2014, aiming to entice automobile manufacturers to speed up the development of electric cars, Musk announced that Tesla would allow its technology patents to be used by anyone in good faith.

In December 2015, Musk announced the creation of OpenAI, a not-for-profit artificial intelligence (AI) research company. OpenAI aims to develop artificial general intelligence in a way that is safe and beneficial to humanity.

Musk believed the key to making space travel affordable was to make rockets reusable, though space industry experts believed reusable rockets were impossible or infeasible. On December 22, 2015, SpaceX successfully landed the first stage of its Falcon rocket back at the launch pad, the first time this had been achieved by an orbital rocket.

On 29 January 2016, Musk owned about 28.9 million Tesla shares, which equates to about 22% of the company.

In February 2016, Musk announced that he had acquired the Tesla.com domain name from Stu Grossman, who had owned it since 1992, and changed Tesla's homepage to that domain.

By 2016, Musk's private trust held 54% of SpaceX stock, equivalent to 78% of voting shares.

In July 2016, Musk released Tesla's "master plan part 2": Create stunning solar roofs with seamlessly integrated battery storage. Expand the electric vehicle product line to address all major segments, including small Sports utility vehicle (SUV) and pickup truck. Develop a self-driving capability that is 10X safer than manual via massive fleet learning. Enable your car to make money for you when you aren't using it.

In July 2016, Tesla started developing their autopilot hardware and software in-house, ending their previous partnership with Mobileye, a subsidiary of Intel Corporation that develops vision-based self-driving cars and advanced driver-assistance systems.

Elon Musk had shared his concerns about the dangers of developing artificial intelligence indiscriminately. Consequently, In 2016, Musk co-founded Neuralink, a neurotechnology startup company to integrate the human brain with artificial intelligence.

In October 2016, the divorce of Riley and Musk was finalized.

On 17 December 2016, while stuck in traffic, Musk tweeted, am going to build a tunnel boring machine and just start digging ..., The company was named 'The Boring Company' (TBC), an American infrastructure and tunnel construction services company.

In July 2017, Musk purchased the domain X.com from PayPal for an undisclosed amount, stating that it has sentimental value to him.

On 20 July 2017, Elon Musk said that he had received what he described as "verbal government approval" to build a hyperloop from New York City to Washington, D.C., stopping in both Philadelphia and Baltimore.

In September 2017, Musk arranged a contract with the government of South Australia for Tesla Energy to install what would then be the world's largest lithium-ion battery pack, to help alleviate energy blackouts in the state. Musk arranged this on Twitter, with the guarantee that it would be installed in 100 days or would be free. This deadline was achieved and the resulting battery exceeded expected performance and returns, despite skepticism from Australian federal politicians.

On 7 May 2018, Musk and Canadian musician Grimes revealed that they had begun dating.

In July 2018, Musk attempted to provide assistance to rescuers during the Tham Luang cave rescue by arranging for his employees to build a small rescue pod.

Musk was elected as a Fellow of the Royal Society (FRS) in 2018.

In 2018, Musk was ranked 25th of the world’s most powerful people by Forbes.

In September 2018, Musk was sued by the U.S. Securities and Exchange Commission (SEC) for a tweet claiming that funding had been secured for potentially taking Tesla private. The lawsuit claimed that verbal discussions Musk held with foreign investors in July 2018 did not confirm key deal terms and thus characterized the tweet as false, misleading, and damaging to investors, and sought to bar Musk from serving as CEO on publicly traded companies. Musk called the allegations unjustified and that he had never compromised his integrity.

Two days calling the allegations unjustified, Musk settled with the SEC, without admitting or denying the SEC's allegations. As a result, Musk and Tesla were fined $20 million each, and Musk was forced to step down temporarily as Tesla chairman while remaining Tesla's CEO.

On 4 October 2018, Musk issued a sarcastic tweet, describing the SEC agency as the "Shortseller Enrichment Commission", despite having agreed to settlement terms a week earlier that his company, Tesla, would monitor his tweets and other communications.

In October 2018, to help solve the Flint water crisis, Musk and the Musk Foundation donated over $480,000 to install new water fountains with filtration systems for access to clean water at all Flint, Michigan schools. As of 2019, approximately 30,000 children in all 12 area schools have free, safe drinking water from the water filtration systems.

In January 2019, Musk traveled to China for the groundbreaking of Tesla's Shanghai Gigafactory, which is the company's first large-scale plant outside the U.S.

On 19 February 2019, Musk stated in a tweet that Tesla would build half a million cars in 2019. The SEC reacted to Musk's tweet by filing in court, initially asking the court to hold him in contempt for violating the terms of a settlement agreement with such a tweet, which was disputed by Musk. This was eventually settled by a joint agreement between Musk and the SEC clarifying the previous agreement details, in which agreement included a list of topics that Musk would need preclearance before tweeting about.

In 2019, Musk was awarded the Starmus Festival's Stephen Hawking Medal for Science Communication.

In October 2019, Musk donated US$1 million to '#TeamTrees' a tree planting initiative to plant 20 million trees led by the YouTube community and in collaboration with Arbor Day Foundation.

In November 2019, Musk unveiled the Tesla Cybertruck, an all-electric battery-powered pickup truck.

On 8 January 2020, Grimes announced that she was pregnant with her first child with Musk. On 4 May 2020, Grimes gave birth to a son named X Æ A-Xii, where his first name is X and Æ is pronounced Ash.

At the start of 2020, Musk was the 35th richest person in the world. Throughout that year, his net worth increased by $150 billion, largely driven by his ownership of around 20% of Tesla stock. During this, Musk's net worth was often volatile. For example, it dropped $16.3 billion in September, the largest such plunge according to Bloomberg. In November of that year, Musk passed Facebook co-founder Mark Zuckerberg to become the third-richest person in the world; a week later he passed Microsoft co-founder Bill Gates to become the second-richest.

In January 2021, Musk promised to donate $100 million as a prize to whoever developed the best carbon capture technology, as he is also a trustee of the X Prize Foundation.

In January 2021, Musk, with a net worth of $185 billion, surpassed Amazon founder Jeff Bezos to become the richest person in the world. Bezos reclaimed the top spot the following month.

In 2021, findings of an antibody testing program that SpaceX worked with doctors and academic researchers to create were published in Nature Communications with Musk listed as a co-author.

While hosting Saturday Night Live in May 2021, Musk remarked that he has Asperger syndrome.

Musk was listed among Time magazine's 100 Most Influential People in 2021, for the fourth time.

Musk confirmed reports that the couple, Musk and Grimes, are "semi-separated" in September 2021, after dating for 3 years.