The three Swedish citizens and one Tunisian pleaded not guilty to charges of terrorism and three of the four pleaded not guilty to illegal possession of weapons. Prosecutors have said they could face life sentences if found guilty.
They are accused of plotting to kill a large number of people in an armed attack on the offices of the daily Jyllands-Posten in Copenhagen's Town Hall square at the end of 2010 and with trying to terrify the population.
"It is our perception that an unknown number of people were to be killed by shooting," chief prosecutor Gyrithe Ulrich told TV2 News outside the courthouse before the trial began.
Standing trial are Mounir Ben Mohamed Dhahri, a Tunisian citizen, and three Swedish citizens - Lebanese-born Munir Awad, Omar Abdalla Aboelazm, born in Sweden to a Swedish mother and an Egyptian father, and Sahbi Ben Mohamed Zalouti, of Tunisian origin.
All four were living in Sweden at the time of their arrest in December 2010, three days before the alleged attack was to have been carried out.
Awad and Zalouti entered the courtroom wearing handcuffs, while Aboelazm and Dhahri had their hands free. When the judge entered the courtroom, Zalouti rose to his feet only after being urged to do so by his lawyer, the three others stood without prompting.
All four pleaded not guilty to the main charge of terrorism, but Dhari pleaded guilty to illegal possession of weapons.
Senior prosecutor Henrik Plaehn showed the court a large automatic pistol, which police have said was found in a car rented by the defendants, and plastic strips which police have said could have been used as handcuffs.
Zalouti's lawyer asked Plaehn to point the gun at the floor, and not wave it around in the air.
Denmark's state security police (PET) have said the attack was meant to be like the 2008 shooting spree in Mumbai, when 10 Pakistani gunmen killed 166 people in a three-day coordinated assault on city landmarks, including two hotels and a Jewish centre.
The PET have said the men belonged to a militant Islamist group and had links to international terrorist networks.
Jyllands-Posten was the paper that first published a dozen cartoons of the Prophet Mohammad, provoking protests in 2006 against Danish interests abroad and riots in countries from the Middle East and Africa to Asia in which at least 50 people died.
The trial continues and a verdict is expected shortly after it ends around June 15.