Trott joins the Byens Hold for an undisclosed fee and has put pen to paper on a four-year contract until the summer of 2028.
The 25-year-old has spent the last two seasons on loan at Copenhagen's domestic rivals Vejle BK, keeping 22 clean sheets in 56 appearances across all competitions.
After making 25 outings for Vejle en route to winning the second-tier title and securing promotion in 2022-23, Trott featured 31 times last season to help secure Danish Superliga safety.
Trott's decision to join Copenhagen on a permanent basis sees him end his eight-year association with West Ham, for whom he made just one senior appearance in a 4-0 FA Cup fourth-round victory over Doncaster Rovers in January 2021.
Trott has "great hunger" to become a champion with Copenhagen
"I am both proud and happy that Copenhagen wanted me on the team," Trott told the Danish club's official website.
"It is a fantastic club that has proven itself both in Denmark and internationally for many years. At the same time, I feel a great hunger to become champions again and take the club far in Europe.
"During my time in Denmark, I have experienced firsthand what it is like to play in front of the fanbase the club has both at Parken and away, and it is really impressive.
"I am very much looking forward to experiencing that, and I will do everything I can to ensure that they, the club, and the team succeed together".
Copenhagen head coach Jacob Neestrup added: "It is good that we have arranged this early, so Nathan can be part of our entire pre-season with the team.
"He is extremely strong in reactions on the line against close-range shots and has good qualities in the field.
"Additionally, we have received top references on him from England and Denmark, which have also given us a healthy impression of him as a person and a competitive sportsman. Now we look forward to getting him out on the training pitch tomorrow with the team."
Copenhagen have signed Trott as a replacement for goalkeeper Kamil Grabara, who will complete a permanent switch to Bundesliga side Wolfsburg on July 1 in a deal that was agreed last summer.
West Ham, meanwhile, as reportedly on the verge of signing experienced goalkeeper Wes Foderingham on a free transfer from Sheffield United.
Foderingham, 33, is set to sign a two-year contract and provide cover for West Ham shot-stoppers Alphonse Areola and Lukasz Fabianski under the tutelege of new head coach Julen Lopetegui.