He remains the world's richest person, despite giving away 64 million shares in Microsoft.
The shares are equivalent to 5% of his total fortune, currently estimated to be $89.9bn.
Since 1994 Mr Gates, 61, and his wife Melinda have given away a total of $35bn in cash and stocks to a range of charitable causes.
The donation was made in June but became public on Monday following the filing of a document with the US Securities and Exchange Commission.
Mr Gates' share in Microsoft is now just 1.3%. Prior to this, Mr Gates gave away $16bn in Microsoft shares in 1999 and $5.1bn in 2000.
The majority of all previous donations have been made to the Bill & Melinda Gates Foundation, which is primarily focused on reducing world poverty, combating infectious diseases and providing universal access to computers.
It is not known who the recipient of this latest donation is, however when federal documents are filed, it usually means new money is being given to a foundation, the Chronicle of Philanthropy reports.
In 2010, Mr and Mrs Gates and the well-known investor and philanthropist Warren Buffett created the Giving Pledge, and as of May 2017, 158 individuals or couples have agreed to contribute at least half of their wealth to charity.
This latest donation is the biggest charitable gift to have been made anywhere in the world so far this year.
The second largest was made by Mr Buffett, who donated almost $3.2bn to the Bill & Melinda Gates Foundation last month.
And the third biggest came from Dell Computer Corporation founder Michael Dell and his wife Susan.
In May the couple gave more than $1bn to their foundation, which focuses on children's issues and community initiatives.

Uber CEO Travis Kalanick made the admission while speaking at a private event in Vancouver, according to Canadian tech news site Betakit.
The $1bn figure was later confirmed with Uber China by Reuters news agency.
US-based Uber launched in China in 2014 and competes against the country's largest taxi app Didi Kuaidi.
Uber is available in more than 40 cities in China. It announced last year that it would expand into 100 Chinese cities over the next 12 months.
"We're profitable in the USA, but we're losing over $1bn a year in China," Betakit quoted Mr Kalanick as saying.
He described China as the firm's largest international marketplace. But Uber's market share is dwarfed by that of the larger Didi Kuaidi.
"We have a fierce competitor that's unprofitable in every city they exist in, but they're buying up market share."
Mr Kalanick has previously said the firm had gone from a tiny 1% share of China's market at the beginning of 2015 to about 30% to 35%.
Didi Kuaidi, which is backed by Chinese tech giants Tencent and Alibaba, has now also partnered with Uber's rival US ride-sharing service Lyft.
Mr Kalanick said he had recently raised about $200m to help the firm compete in emerging markets, Betakit said.
"I wish the world wasn't that way. I prefer building rather than fundraising. But if I don't participate in the fundraising bonanza, I'll get squeezed out by others buying market share," he added.
Uber is available in 380 cities around the world, according to the website.

Police said they received a report of the fire at a property in Castle Mews at about 03:30 BST on Saturday.
A tyre had been put against the front door of the house and set alight. The blaze caused smoke damage.
A man, a woman and two boys inside the property were not injured.
Det Insp Tara Nicholls said: "I would appeal to anyone that was in the area and noticed any suspicious activity between the times of 01:30 and 03:30 BST to contact CID at Cookstown Police Station on the non emergency number 101."
Bill Gates has given away $4.6bn (Â£3.6bn) to charity in his largest donation since 2000.
[NEXT_CONCEPT]
App-based car-hire service Uber is losing more than $1bn (Â£699m) a year in China, as it struggles against what it called a "fierce competitor".
[NEXT_CONCEPT]
Four people have escaped injury after an arson attack in Cookstown, County Tyrone.