Allah is known through His Names and Attributes, not through imagining Him
Islam does not teach that Allah is a “formless God,” nor does it teach Muslims to create a mental image of Him while praying.
Rather, Muslims believe in Allah as He has described Himself in the Qur’an and as His Messenger ﷺ described Him, affirming His Names and Attributes without likening Him to His creation and without attempting to imagine how His Attributes are.
Allah says:
لَيْسَ كَمِثْلِهِ شَيْءٌ وَهُوَ السَّمِيعُ الْبَصِيرُ
“There is nothing like unto Him, and He is the All-Hearing, the All-Seeing.”
[Qur’an 42:11]
This verse combines two fundamental principles: Allah is unlike His creation, yet He truly possesses the Attributes that He has affirmed for Himself.
Allah also says:
وَلَا يُحِيطُونَ بِهِ عِلْمًا
“But they cannot encompass Him in knowledge.”
[Qur’an 20:110]
Therefore, the fact that we cannot comprehend or visualize Allah does not mean that Muslims have “no conception of God.” We know Allah through what He has revealed concerning Himself, while recognizing that the reality and how (kayfiyyah) of His Attributes are beyond our knowledge.
What does a Muslim think about during prayer?
A Muslim does not pray by trying to visualize Allah. He worships Allah with īmān, khushūʿ (humility and attentiveness), remembrance, recitation, supplication, hope and fear.
Allah says:
وَأَقِمِ الصَّلَاةَ لِذِكْرِي
“And establish prayer for My remembrance.”
[Qur’an 20:14]
The clearest explanation is found in the famous ḥadīth of Jibrīl. The Prophet ﷺ explained iḥsān as:
أَنْ تَعْبُدَ اللَّهَ كَأَنَّكَ تَرَاهُ، فَإِنْ لَمْ تَكُنْ تَرَاهُ فَإِنَّهُ يَرَاكَ
“That you worship Allah as though you see Him; and if you do not see Him, then indeed He sees you.”
[Ṣaḥīḥ al-Bukhārī, 50; Ṣaḥīḥ Muslim, 8]
Notice that the Prophet ﷺ did not instruct the worshipper to construct an image of Allah. Rather, the worshipper is conscious that he is standing before his Lord and that Allah sees him, hears him and knows his condition.
This produces khushūʿ in prayer.
We affirm what Allah affirmed about Himself
The Salaf followed a very precise principle regarding Allah’s Attributes: affirm the revelation without asking “how?” and without comparing Allah to creation.
When Imām Mālik رحمه الله was asked about Allah’s istiwaʾ over the Throne and how it is, he famously replied:
الاستواء معلوم، والكيف مجهول، والإيمان به واجب، والسؤال عنه بدعة
“Istiwaʾ is known, its ‘how’ is unknown, believing in it is obligatory, and asking about its ‘how’ is an innovation.”
This principle applies generally to the Attributes of Allah: we understand their meanings, but we do not know their modality (kayfiyyah).
Allah says:
هَلْ تَعْلَمُ لَهُ سَمِيًّا
“Do you know of anyone comparable to Him?”
[Qur’an 19:65]
And:
وَلَمْ يَكُنْ لَهُ كُفُوًا أَحَدٌ
“And there is none comparable to Him.”
[Qur’an 112:4]
Therefore
The question contains a false dilemma: either God must have a form that humans can mentally picture, or people cannot meaningfully think about Him.
Islam accepts neither proposition.
A Muslim knows Allah through His Names, His Attributes, His revelation, His actions and His signs in creation. He remembers Allah, loves Him, fears Him, hopes in Him, supplicates to Him and worships Him, but he does not invent a mental representation of Allah.
As for prayer five times a day, its purpose is not to meditate upon an imagined form of God. It is an act of worship and remembrance in which the believer stands before his Lord with the consciousness described by the Prophet ﷺ:
“If you do not see Him, indeed He sees you.”
And Allah knows best.