Police found Swartz's body in his apartment in the New York City borough of Brooklyn on Friday, according to a spokeswoman for the city's chief medical examiner, which ruled the death a suicide by hanging.
His death came weeks before he was to go on trial on charges that could have sent him to prison for decades.
Swartz faced trouble in July 2011, when he was indicted by a federal grand jury of wire fraud, computer fraud and other charges related to allegedly stealing millions of academic articles and journals from a digital archive at the Massachusetts Institute of Technology.
That pressure may have contributed to his death, but Swartz also had battled depression for years, said his friend Cory Doctorow, the novelist and blogger.
Tim Berners-Lee, who is credited as the most important figure in the creation of the World Wide Web, commemorated Swartz in a Twitter post on Saturday.
"Aaron dead," he wrote. "World wanderers, we have lost a wise elder. Hackers for right, we are one down. Parents all, we have lost a child. Let us weep."
His funeral will be Tuesday at Central Avenue Synagogue in Highland Park, according to his family, who said details, including the time, will be posted on a memorial website.
Like what you’ve read? Subscribe to receive (spam free) email notification of top news articles.
Got something to say? Say it on Examiner by following this link to sign up.