The 36-year-old singer donated the wide-rimmed black hat to Heritage Auctions, that is dedicated to raise funds for lung research, reported TMZ.com.
Beyonce autographed the hat with "All my love".
The item was predicted to sell less than USD 2,000, but as several bidders turned up for the auction, the gavel struck at the price of USD 27,500.
Pharrell also contributed to the cause by donating two pairs of his Adidas Originals and they were together sold for USD 11,375, having originally been expected to sell for around USD 1,000.
Disclaimer: No Business Standard Journalist was involved in creation of this content