The Justice Department asserts that Payton Gendron was motivated by racist hate when he took a semi-automatic assault weapon to a grocery store in a largely Black neighborhood of Buffalo and killed 10 people, while wounding three others.
The federal hate crime charges carry the death penalty or up to life in prison.
The charges state that he was driven by belief in a conspiracy theory called "The Great Replacement" -- that white people's lives and communities are threatened by minorities -- a view Gendron espoused in a lengthy document posted online before his attack.
He said in his manifesto that he intended to "Kill as many Blacks as possible."
"Gendron's motive for the mass shooting was to prevent Black people from replacing white people and eliminating the white race, and to inspire others to commit similar attacks," the charges said.
He planned his attack in detail for months, according to the charges, and he specifically targeted a heavily Black community, mapping out the popular Tops supermarket there.
Attorney General Merrick Garland announced the charges on a visit to Buffalo, where he met with family members of those killed.
"Hate-fuelled acts of violence terrorize not only the individuals who are all attacked but entire communities," Garland said.
"We fully recognize the threat that hatred and violent extremism pose to the safety of the American people and American democracy," he said.
Prior to the federal charges, Gendron was arraigned by New York state, accused of domestic terrorism and ten counts of first degree murder.