Two ahadith are usually cited to show the prophet was literate - I'll consider each in this answer:
The Prophet (saw) wanted to write before his death
When the Prophet (saw) was ill before his death, he told asked those around his deathbed to bring him a sheet to write some instructions for them. It was narrated he said:
ائْتُونِي بِالْكَتِفِ وَالدَّوَاةِ - أَوِ اللَّوْحِ وَالدَّوَاةِ - أَكْتُبْ لَكُمْ كِتَابًا لَنْ تَضِلُّوا بَعْدَهُ أَبَدًا
"Bring me a shoulder blade and ink-pot (or tablet and inkpot), so that I write for you a document (by following which) you would never go astray." (Sahih Muslim 1637 b)
The argument here is then the prophet was asking for writing materials to write something for them, so he must have been literate to do this.
It is not uncommon to say something like, "the president wrote to so and so" meaning he ordered someone to do so. For example, the prophet wrote messages to kings and the narrations use the term wrote (كتب) but the Prophet certainly appointed writers for this job who wrote them on his behalf. (Tafseer al-Qurtubi, Vol. 13, p. 352)
This is supported by Ibn Hajar al-Asqalani's observation that in the normal course of events, the Prophet (saw) appointed writers to write the revelation, messages to kings and contracts. It would be unusual to say he wanted to write himself in his last death throes. (Ibn Hajar, Fath al-Bari, Vol. 7, pp. 504-505)
There is no narration saying he actually wrote anything whilst there are many narrations where he would ask others to write for him - this leaves this interpretation as highly doubtful.
Furthermore, the Prophet (saw) was extremely ill as Aisha (ra) said:
دَخَلَ عَلَىَّ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ وَهُوَ بَيْنَ رَجُلَيْنِ وَرِجْلاَهُ تَخُطَّانِ بِالأَرْضِ
"The Messenger of Allah (saw) entered upon me, (supported) between two men, with his feet making lines along the ground." (Ibn Majah Hadith 1686)
In such a state, even if he could write, he would not have been able to write. This would suggest what he meant was 'he would ask someone to write.'
The Prophet (saw) wrote part of the Hudaybiyyah Treaty
It was narrated regarding the Hudaybiyyah treaty:
فَلَمَّا كَتَبُوا الْكِتَابَ كَتَبُوا، هَذَا مَا قَاضَى عَلَيْهِ مُحَمَّدٌ رَسُولُ اللَّهِ. قَالُوا لاَ نُقِرُّ بِهَذَا، لَوْ نَعْلَمُ أَنَّكَ رَسُولُ اللَّهِ مَا مَنَعْنَاكَ شَيْئًا، وَلَكِنْ أَنْتَ مُحَمَّدُ بْنُ عَبْدِ اللَّهِ. فَقَالَ " أَنَا رَسُولُ اللَّهِ، وَأَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ ". ثُمَّ قَالَ لِعَلِيٍّ " امْحُ رَسُولَ اللَّهِ ". قَالَ عَلِيٌّ لاَ وَاللَّهِ لاَ أَمْحُوكَ أَبَدًا. فَأَخَذَ رَسُولُ اللَّهِ صلى الله عليه وسلم الْكِتَابَ، وَلَيْسَ يُحْسِنُ يَكْتُبُ، فَكَتَبَ هَذَا مَا قَاضَى مُحَمَّدُ بْنُ عَبْدِ اللَّهِ
"When the agreement was being written, the Muslims wrote: "This is the peace treaty, which Muhammad, Apostle of Allah, has concluded."
The infidels said to him, "We do not agree with you on this, for if we knew that you are Apostle of Allah, we would not have prevented you from anything (i.e. entering Mecca, etc.), but you are Muhammad, the son of Abdullah."
Then he said to Ali, "Erase Apostle of Allah'."
Ali said, "No, by Allah, I will never erase you (i.e. your name)."
Then Allah's Messenger (saw) took the writing sheet, and he did not know a better writing, and he wrote the following: 'This is the peace treaty which Muhammad, the son of Abdullah…'" (Sahih al-Bukhari 4251)
The argument here is this demonstrates the Prophet (saw) could write.
This however does not give the full picture as it ignores other evidences that elaborate this event in further detail.
Scholars however argue the term 'wrote' (كتب) that appears in this hadith has to be understood in light of other narrations, as narrations explain one another. They say he ordered Ali to write and others state he did not know the place of the written line. It is narrated in al-Bukhari:
فَقَالَ لِعَلِيٍّ " امْحُ رَسُولَ اللَّهِ ". فَقَالَ عَلِيٌّ وَاللَّهِ لاَ أَمْحَاهُ أَبَدًا. قَالَ " فَأَرِنِيهِ ". قَالَ فَأَرَاهُ إِيَّاهُ، فَمَحَاهُ النَّبِيُّ صلى الله عليه وسلم بِيَدِهِ
"He (the Prophet) asked Ali to erase the expression of Apostle of Allah. On that Ali said, 'By Allah, I will never erase it.' Allah's Apostle said (to Ali), 'Let me see the phrase. When Ali showed him the phrase, the Prophet (saw) erased the expression with his own hand." (Sahih al-Bukhari 3184)
In the narration of Muslim, it says:
فَأَمَرَ عَلِيًّا أَنْ يَمْحَاهَا فَقَالَ عَلِيٌّ لاَ وَاللَّهِ لاَ أَمْحَاهَا . فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " أَرِنِي مَكَانَهَا " . فَأَرَاهُ مَكَانَهَا فَمَحَاهَا وَكَتَبَ " ابْنُ عَبْدِ اللَّهِ " .
"He (the Prophet) told Ali to strike out the words. Ali said: No, by Allah, I will not strike them out. The Messenger of Allah (may Peace be upon him) said: Show me their place (on the parchment). So Ali showed him their place and the Prophet struck them out; and Ali wrote: Ibn Abdullah." (Sahih Muslim 1783 c)
In the previous two narrations, the prophet could not recognize the written line and asked Ali to show him the words.
In light of this narration, scholars argue the sentence in the first hadith, "Then Allah's Messenger (saw) took the writing sheet" refers to the sentence in the other two clarifying narrations: "he (the Prophet) struck them out," then Ali "he wrote" the rest. (al-Qurtubi, Ibn Hajar and Ibn Kathir)
Both narrations, when reviewed in detail and contextualised, do not suggest the literacy of the Prophet. In fact they show the converse - the prophet's illiteracy.
Great answers start with great insights. Content becomes intriguing when it is voted up or down - ensuring the best answers are always at the top.
Questions are answered by people with a deep interest in the subject. People from around the world review questions, post answers and add comments.
Be part of and influence the most important global discussion that is defining our generation and generations to come