NEW YORK — Computer prodigy Aaron Swartz, who helped develop RSS and co-founded Reddit, has been found dead weeks before he was to go on trial on federal charges that he stole millions of scholarly articles in an attempt to make them freely available to the public.

Swartz, 26, hanged himself in his Brooklyn apartment, his family in Chicago confirmed in a statement Saturday. He was pronounced dead Friday evening at home in the Crown Heights neighborhood, Ellen Borakove, spokeswoman for New York’s chief medical examiner, said.

As a young teenager, Swartz helped create RSS, a family of Web feed formats used to gather updates from blogs, news headlines, audio and video for users. He co-founded the social news website Reddit, which was later sold to Conde Nast, as well as the political action group Demand Progress, which campaigns against Internet censorship.

A zealous advocate of public online access, Swartz was extolled Saturday by those who believed as he did. He was “an extraordinary hacker and activist,” the Electronic Frontier Foundation, an international nonprofit digital rights group based in California wrote in a tribute on its home page.

“Playing Mozart’s Requiem in honor of a brave and brilliant man,” tweeted Carl Malamud, an Internet public domain advocate who believes in free access to legally obtained files.

Swartz apparently struggled at times with depression, writing in a 2007 blog post: “Surely there have been times when you’ve been sad. Perhaps a loved one has abandoned you or a plan has gone horribly awry. … You feel worthless. … depressed mood is like that, only it doesn’t come for any reason and it doesn’t go for any either.”

In their statement, Swartz’s family expressed not only grief over his death but bitterness toward federal prosecutors pursuing the case in Massachusetts against him.

“Aaron’s death is not simply a personal tragedy. It is the product of a criminal justice system rife with intimidation and prosecutorial overreach,” the statement from his family and girlfriend said.

Harvard law professor Lawrence Lessig, faculty director for Safra Center for Ethics where Swartz was once a fellow, wrote: “We need a better sense of justice. … The question this government needs to answer is why it was so necessary that Aaron Swartz be labeled a ‘felon.'”

U.S. Attorney Carmen Ortiz in Boston could not be reached for comment. She previously has said that “stealing is stealing, whether you use a computer command or a crowbar, and whether you take documents, data or dollars,” The New York Times reported Saturday.

Preceding the Massachusetts’ case, Swartz aided Malamud in his effort to post federal court documents for free online, rather than the few cents per page that the government charges through its electronic archive, PACER. Swartz wrote a program in 2008 to legally download the files using free access via public libraries, according to The New York Times. About 20 percent of all the court papers were made available until the government shut down the library access.

The FBI investigated but did not charge Swartz, he wrote on his own website.

Three years later, Swartz was arrested in Boston. The federal government accused Swartz of using the Massachusetts Institute Technology’s computer network to steal nearly 5 million academic articles. The indictment alleged Swartz stole the documents from JSTOR, a subscription service used by MIT that offers digitized copies of articles from more than 1,000 academic journals.

Prosecutors said Swartz hacked into MIT’s system in November of 2010 after breaking into a computer wiring closet on campus. Prosecutors said he intended to distribute the articles on file-sharing websites.

JSTOR did not press charges once it reclaimed the articles from Swartz, and some legal experts considered the case unfounded, saying that MIT allows guests access to the articles and Swartz, a fellow at Harvard’s Safra Center for Ethics, was a guest.

Experts puzzled over the arrest and argued that the result of the actions Swartz was accused of was the same as his PACER program: more information publicly available.

The prosecution “makes no sense,” Demand Progress Executive Director David Segal said in a statement at the time. “It’s like trying to put someone in jail for allegedly checking too many books out of the library.”

Swartz faced 13 felony charges, including breaching site terms and intending to share downloaded files through peer-to-peer networks, computer fraud, wire fraud, obtaining information from a protected computer, and criminal forfeiture.

He pleaded not guilty to the charges. His federal trial was to begin next month. If convicted, he faced decades in prison and a fortune in fines.

JSTOR announced this week that it would make “more than 4.5 million articles” publicly available for free.