He drove three hours from his home near Binghamton, New York, to the Tops Friendly Markets store in Buffalo after planning the attack for weeks, authorities said. He was looking for a public location in an area where many Black people lived.
Gendron initially pleaded not guilty after a grand jury indictment in June.
He faces a mandatory sentence of life in prison without parole on the domestic terrorism charge alone. New York does not have a death penalty.
Gendron was the first defendant in New York ever to be indicted for a domestic act of terrorism motivated by hate in the first degree.
At the supermarket, he shot 13 people with a semi-automatic, assault-style rifle. Eleven of the victims were Black.
Police say he left a racist manifesto online before the attack and live-streamed the shooting on social media.