Who wrote the Koran and when?

The words of the Koran were collected as they were revealed to the prophet Muhammad, committed by memory by the first Muslims and recorded in writing by the scribes.

Under the supervision of the prophet Muhammad
As the Quran was revealed, the prophet Muhammad made special arrangements to make sure it was written. Although the prophet Muhammad himself could neither read nor write, he dictated the verses orally and ordered the scribes to write down the revelation on whatever material was available: tree branches, stones, leather and bones. The scribes would then read their writings to the Prophet, who would check them for errors. With each new verse revealed, the prophet Muhammad also dictated his placement within the growing body of texts.

When the prophet Muhammad died, the Koran had been completely written. However, it was not in book form. It was recorded on various scrolls and materials, held in the possession of the Companions of the Prophet.

Under the supervision of Caliph Abu Bakr
After the death of the prophet Muhammad, the whole Quran continued to be remembered in the hearts of the early Muslims. Hundreds of the first Companions of the Prophet had memorized the entire revelation, and Muslims recited large parts of the text from memory every day. Many of the early Muslims also had written personal copies of the Koran recorded on various materials.

Ten years after Hijrah (632 AD), many of these Muslim scribes and early devotees were killed in the Battle of Yamama. While the community mourned the loss of their companions, they also began to worry about the long-term preservation of the Holy Quran. Recognizing that Allah's words were to be collected in one place and kept, Caliph Abu Bakr ordered all the people who had written pages of the Qur'an to fill them out in one place. The project was organized and supervised by one of the key scribes of the prophet Muhammad, Zayd bin Thabit.

The process of compiling the Koran from these various written pages was done in four stages:

Zayd bin Thabit has verified each verse with his own memory.
Umar ibn Al-Khattab has verified every verse. Both men had memorized the whole Quran.
Two reliable witnesses had to testify that the verses were written in the presence of the prophet Muhammad.
The verified written verses were collected with those of the collections of other companions.
This method of cross-checking and verification from more than one source has been adopted with the utmost care. The aim was to prepare an organized document that the whole community could verify, approve and use as a resource when needed.

This full text of the Qur'an was held in Abu Bakr's possession and then passed on to the next caliph, Umar ibn Al-Khattab. After his death, they were given to his daughter Hafsah (who was also a widow of the prophet Muhammad).

Under the supervision of Caliph Uthman bin Affan
When Islam began to spread across the Arabian Peninsula, more and more people entered the fold of Islam from as far away as Persia and the Byzantine. Many of these new Muslims were not Arabic native speakers or spoke a slightly different Arabic pronunciation from the tribes of Mecca and Madina. People started arguing about which pronouncements were most correct. Caliph Uthman bin Affan took it upon himself to ensure that the recitation of the Qur'an is a standard pronunciation.

The first step was to borrow the original, compiled copy of the Qur'an from Hafsah. A committee of early Muslim scribes was commissioned to make transcriptions of the original copy and to ensure the sequence of chapters (sura). When these perfect copies were completed, Uthman bin Affan ordered that all remaining transcriptions be destroyed, so that all copies of the Qur'an were uniform in the script.

All the Korans available today in the world are exactly identical to the Uthmani version, which was completed less than twenty years after the death of the prophet Muhammad.

Subsequently, some small improvements were made to Arabic writing (addition of diacritic dots and marks) to facilitate reading by non-Arabs. However, the text of the Qur'an has remained the same.