(CNN) YouTube star MrBeast wanted to do something big to celebrate reaching 20 million subscribers, so his fans challenged him to plant 20 million trees.
He's raised more than $8.2 million in just a few days with donations from Elon Musk, Twitter CEO Jack Dorsey and his legion of fans.
MrBeast, who's real name is Jimmy Donaldson, is known for his random and often elaborate acts of generosity and stunts, such as building a mansion out of cardboard and going through the same drive-thru a thousand times.
He and fellow YouTuber Mark Rober have partnered with the Arbor Day Foundation to raise the money and get the trees in the ground.
More than 300,000 people have made donations since the TeamTrees campaign launched on Friday afternoon, Arbor Day Foundation spokesman Danny Cohn told CNN.
Elon Musk, of Tesla and SpaceX fame, gave $1 million dollars and even changed his Twitter name to "Treelon."
Dorsey gave $150,000, Norwegian DJ and record producer Alan Walker gave $100,001 and MrBeast gave $100,002 to his own cause.
"The average person can't afford $150,000 or a million, but we've been getting spikes of between 5 and 20 trees every time a large donation comes in and every tree matters, every single donor is important," Cohn said.
The Arbor Day Foundation will work with its local partners around the world to plant one tree for each dollar they raise.
It will take time to get the right trees to the right places -- and dig 20 million holes -- but Cohn said they expect to have all the trees planted by 2022, which is its 150th anniversary.
"We really want to make sure they are being placed where they can do the most good for the Earth," he said.
Cohn said that the big celebrity donations have inspired young people to give at a rate that they've never seen before. "This is just another fact of this generation seeing the importance of getting trees in the ground to help the future of the earth," he said.
The Arbor Day Foundation says that 100 million trees absorb 8 million tons of carbon over their lifetime, which is the equivalent of taking 6.2 million cars off the road for one year. The trees will also reduce water runoff and filter pollutions and microparticles from the atmosphere. They are expected to generate $32.9 billion in environmental benefits.