The Istanbul criminal court handed Abdulkadir Masharipov 40 life sentences - one for each of the victims and one for the massacre itself - for "deliberate murder" and "violating the constitution," the official Anadolu news agency said.
Masharipov received a separate, additional 1,368 year sentence for attempted murder and a firearm law violation.
The court also sentenced fellow convict Ilyas Mamasaripov to 1,432 years in prison for helping plot the attack, the report said.
The Islamic State (IS) group claimed responsiblity for the slaying in the upscale Reina nightclub overlooking the Bosphorus.
The attack killed 27 foreigners, including nationals from Lebanon, Saudi Arabia, Israel, Iraq and Morocco.
Masharipov was caught after a concerted manhunt on January 17, 2017.
The country was hit by a string of terror attacks blamed on jihadists and Kurdish militants in 2015 and 2016.
Turkey has since stepped up its campaign against the IS group at home and abroad.
Last week, the government reported the capture of an alleged IS member it said oversaw the group's Turkey operations.
Follow us on Facebook, Twitter and Instagram to stay connected