Three more bodies were found in his home, officials said.
The scenes of blood and bodies strewn across the historic heart of one of Poland's main tourist attractions shocked a nation that has long viewed itself as safer than western European neighbours that have witnessed such attacks in the past.
The mass shooting of unprecedented scale adds to the sense of unease built by a string of school stabbings in October, which authorities said was influenced by violent and extremist content online.
"Everything points to the fact that the shooter was influenced by far-right ideology, a matter that will also be subject to investigation," Interior Minister Marcin Kierwinski told a news briefing on Saturday.
"Police officers are on site, as are agents from the Internal Security Agency, both here at the scene and at the individual's family home."
Polish authorities have said four women and two men were killed in the attack in the city centre.
Sixteen others, including two police officers, were wounded.
One of the dead people identified was a British citizen, police said.
An interior ministry spokesperson said the five foreign nationals injured in the shooting came from Austria, Germany, Portugal, Russia and Britain.
A spokesperson for the Lesser Poland Voivodeship office, the southern region where Krakow lies, told Reuters the injured police officers were in stable condition after undergoing surgery, and the justice minister called for blood donations for one of the wounded officers.
The spokesman also said the shooter was in "stable but very critical condition" after multiple surgeries.
Videos posted online had shown the assailant falling to the ground during a close-range shootout with police officers firing handguns.
Prime Minister Donald Tusk said the bodies of two women and one man had been found at the shooter's home in Ostrowiec Swietokrzyski, just under 200km north of Krakow.
"There are strong indications that they are members of his immediate family," Tusk told a crisis meeting.
Speaking along with the prime minister, Tomasz Siemoniak, the minister co-ordinating special services, said Poland's Internal Security Agency and Military Counterintelligence Service are supporting the investigation.
Police said alleged gunman was a 24-year-old Polish citizen who had a firearms licence.
He used an AR-15 rifle and wore military-like clothes during the attack, with weapons and ammunition found in his vehicle.
Police said they started to receive reports about 3pm that an assailant had opened fire from a car and had shot randomly at people in the square in Poland's second-largest city, a popular tourist destination.
Kierwinski praised the heroism of officers who apprehended the suspect.
"The police prevented a much larger massacre that could have otherwise occurred," he said.
"They fired shots at the attacker just three minutes after receiving the report."
President Karol Nawrocki declared a period of national mourning on November 8 and 9.
Expressions of shock and condolence flooded in from around Europe, including from Ukrainian President Volodymyr Zelenskiy and European foreign policy chief Kaja Kallas, who called it "a tragedy that will be felt far beyond Poland".