Short answer
Both mean the one Creator, but they say different things about Him. The Mul Mantar opens the Guru Granth Sahib, the scripture Sikhs honour as their living Guru. It calls God one, the Creator, without fear or enmity, immortal, unborn and self-existent. That is close to Surat al-Ikhlas (112), which says Allah (﷾) is One and is not begotten. The two faiths part on three points. One is whether God's (﷾) Light is in all things. Another is whether the Guru is one with God (﷾). The third is how God (﷾) is to be worshipped. Islam says nothing is like Him, and that a messenger is a man sent by God (﷾), never one with Him. Naming the Creator is the start, not the whole. Islam calls on Him by the names He gave Himself, and asks you to hear the last Prophet (ﷺ) He sent.
Full explanation
The Mul Mantar, the creed of the Guru Granth Sahib
The Guru Granth Sahib is the scripture Sikhs honour as their living Guru. It opens with the Mul Mantar, a short creed by Guru Nanak (Sikhs say Guru Nanak Dev Ji). He founded Sikhism (Sikhs also say Sikhi). Its first words in the Gurmukhi script are Ik Onkar, often rendered "One Creator". Macauliffe made his English translation of the Sikh scriptures with the help of Sikh scholars, and Oxford published it in 1909. His rendering of the Mul Mantar is shown below. It names one God (﷾), whose name is true, the Creator. It says He is without fear or enmity, and that He is immortal, unborn and self-existent.
“There is but one God whose name is true, the Creator, devoid of fear and enmity, immortal, unborn, self-existent”
Surat al-Ikhlas, the Qur'an's own statement
Surat al-Ikhlas (Sincerity) is the short chapter in which the Qur'an says who Allah (﷾) is. The Mul Mantar and the chapter agree that God (﷾) is one and that He is not born. The chapter goes further: He neither begets nor is begotten, and none is like Him. Qur'an 42:11 calls Him the Creator of the heavens and the earth, and says again that nothing is like Him. The Mul Mantar adds that He is free of fear and enmity, which the Qur'an does not put in those words. So the two statements are close.
“Say: He is Allah, the One and Only; Allah, the Eternal, Absolute; He begetteth not, nor is He begotten; And there is none like unto Him.”
“(He is) the Creator of the heavens and the earth: He has made for you pairs from among yourselves, and pairs among cattle: by this means does He multiply you: there is nothing whatever like unto Him, and He is the One that hears and sees (all things).”
The names the Guru Granth Sahib uses for God (﷾)
Guru Arjan, the fifth Guru, addresses God (﷾) in a Tilang hymn as Allah (﷾) and as the merciful Khuda. In another hymn, in Raga Ramkali, he reports how people call on God (﷾): some say Ram, some Khuda, some Gusain, some Allah (﷾). A third hymn is by the Bhagat Kabir, a poet whose hymns are in the Guru Granth Sahib. He was not one of the Gurus. He writes that first Allah (﷾) created the Light. These lines show that the Guru Granth Sahib uses the names Muslims use (Arabic Allah (﷾), Persian Khuda) for the one Creator. They do not show what else it says about Him, which is the next question.
“O Allah, Thou Thyself art the Lord of the world, the merciful Khuda.”
Guru Arjan writes that some call God Ram, Ram and some Khuda, and that some serve Him as Gusain and others as Allah. He calls Him the Cause of causes, the Generous, the Merciful. The hymn goes on to list how people differ: some bathe at holy waters and some go to Mecca, some read the Vedas and some the Kateb, some say Hindu and some say Muslim. It ends that whoever knows God's Will knows the secret of his Lord.
The Bhagat Kabir, whose hymns are in the Guru Granth Sahib and who was not one of the ten Gurus, writes that first Allah created the Light, and then by His creative power made all mortal beings. From the one Light the whole universe welled up, so who is good and who is bad?
Near to the world, and above it
The Qur'an says He is firmly established on the Throne. It also says He is with you wherever you are, and "I am indeed close" to those who ask. It says too "We are nearer to him than (his) jugular vein", which Ibn Kathir reads of His angels, and others read of His knowledge. Ibn Kathir reads "with you" as Allah's (﷾) watching and knowing. He says the scholars reject any claim that God (﷾) dwells in His creation or is united with it. The Guru Granth Sahib also speaks both ways. Guru Nanak's Arti says the Light is in everything. Guru Arjan says God (﷾) is unsullied by the whole creation. Sikh teachers describe this as God (﷾) present in all and yet beyond all. Islam also says He is near and above all, but not in the same way. He is near by His knowledge, hearing and sight, not by being in the things He made. And nothing is like Him.
“He it is Who created the heavens and the earth in Six Days, and is moreover firmly established on the Throne (of Authority). He knows what enters within the earth and what comes forth out of it, what comes down from heaven and what mounts up to it. And He is with you wheresoever ye may be. And Allah sees well all that ye do.”
“(Allah) Most Gracious is firmly established on the throne (of authority).”
“When My servants ask thee concerning Me, I am indeed close (to them): I listen to the prayer of every suppliant when he calleth on Me: Let them also, with a will, Listen to My call, and believe in Me: That they may walk in the right way.”
“It was We Who created man, and We know what dark suggestions his soul makes to him: for We are nearer to him than (his) jugular vein.”
Ibn Kathir begins by recalling that Allah created the heavens and the earth in six days and then rose over the Throne. On "He is with you wherever you are" he says it means that Allah watches over you and is witness to your deeds wherever you are, on land or sea, by night or day. Everything lies equally within His knowledge, His sight and His hearing: He hears your words, sees your place and knows your secrets.
Ibn Kathir says the verse tells of Allah's power over man as his Creator, and of His knowledge, which encompasses all his affairs. On "We are nearer to him than (his) jugular vein", he says it means that Allah's angels are nearer to a man than his jugular vein. Those who took it to mean Allah's knowledge, he says, did so to avoid any implication of indwelling (hulul) or union (ittihad), both of which are rejected by the consensus of the scholars.
“The light which is in everything is Thine, O Lord of light.”
“Thou alone art my spiritual and temporal Lord; Thou art unsullied by the whole creation.”
“(He is) the Creator of the heavens and the earth: He has made for you pairs from among yourselves, and pairs among cattle: by this means does He multiply you: there is nothing whatever like unto Him, and He is the One that hears and sees (all things).”
The Guru and the Transcendent Lord
Guru Arjan writes that the Guru and the Transcendent Lord are One. Many Sikh teachers read "the Guru" in such lines as God's (﷾) Word and Light. They honour the ten human Gurus as bearers of that Light. The line is one of the reasons Sikhs and Muslims describe worship differently.
Guru Arjan writes: know that the Guru and the Transcendent Lord are One. In the same hymns he calls the Guru the Creator and the Transcendent Lord, and says that without the Guru no one is set free.
The messenger is a man, and God (﷾) has no partner
The Qur'an has its own messenger say that he is a man like his hearers, to whom revelation comes. It teaches that God (﷾) has no partner in His being and that nothing is like Him. Islam honours every messenger and makes none of them God. That is where the Qur'an draws its line, and it asks that the line be kept.
“Say: "I am but a man like yourselves, (but) the inspiration has come to me, that your Allah is one Allah: whoever expects to meet his Lord, let him work righteousness, and, in the worship of his Lord, admit no one as partner.”
“Say: He is Allah, the One and Only; Allah, the Eternal, Absolute; He begetteth not, nor is He begotten; And there is none like unto Him.”
Naming the Creator is the start
The Qur'an says to call on Allah (﷾) by the Most Beautiful Names that belong to Him. It also says that to call on Allah (﷾) or on Rahman is well, since both are His names. It records that the idol-worshippers of Mecca, asked who created the heavens and the earth, said "Allah". Even so, the Qur'an called them to worship Him alone. The verse is not about Sikhs. It shows that the Qur'an asks more than naming the Creator: it asks that He be worshipped as He taught, through the messenger He sent.
“The most beautiful names belong to Allah: so call on him by them; but shun such men as use profanity in his names: for what they do, they will soon be requited.”
“Say: "Call upon Allah, or call upon Rahman: by whatever name ye call upon Him, (it is well): for to Him belong the Most Beautiful Names. Neither speak thy Prayer aloud, nor speak it in a low tone, but seek a middle course between."”
“If indeed thou ask them who has created the heavens and the earth and subjected the sun and the moon (to his Law), they will certainly reply, "Allah". How are they then deluded away (from the truth)?”
Five replies answered
Guru Granth Sahib, Ang 13 — Sohila (the Arti), Guru Nanak
“The light which is in everything is Thine, O Lord of light.”
Cited for
God is in everything: His Light is in all. Islam makes Him distant, and a God apart from the world cannot be close to anyone.
The response
Islam does not make Him distant. The Qur'an has Him say "I am indeed close", and says He is with you wherever you are. Ibn Kathir reads "with you" as His watching, hearing and knowing. Guru Arjan also calls God "unsullied by the whole creation", so the Guru Granth Sahib too holds Him beyond what He made. Islam says He is firmly established on the Throne and knows all, and that nothing is like Him.
Where it lands — Both say God (﷾) is near. Islam says He is near by knowledge, hearing and sight, not present in His creatures, and that nothing is like Him.
Guru Granth Sahib, Ang 724 — Raga Tilang, Guru Arjan
“O Allah, Thou Thyself art the Lord of the world, the merciful Khuda.”
Cited for
The name does not matter. The Guru Granth Sahib calls Him Allah, Khuda and Ram alike, so Muslims are dividing over words.
The response
Islam grants that the Guru Granth Sahib uses Allah (﷾) and Khuda, and the Qur'an allows Allah (﷾) or Rahman. The names Muslims use are the ones He gave Himself, and He tells us to call on Him by them. Muslims do not claim that every word used for God (﷾), such as Ram or Waheguru, is one of His names. The question is not a quarrel over words. It is what is said of Him, and who taught it.
Where it lands — Islam calls on Him by the names He gave Himself (7:180; 17:110).
Guru Granth Sahib, Ang 864 — Raga Gond, Guru Arjan
Guru Arjan writes: know that the Guru and the Transcendent Lord are One. In the same hymns he calls the Guru the Creator and the Transcendent Lord, and says that without the Guru no one is set free.
Cited for
Guru Arjan writes that the Guru and God are One, so the Light in the Guru is God's own. The Shabad Guru is God's own Word, as Muslims hold of the Qur'an.
The response
Many Sikh teachers read "the Guru" in such lines as God's (﷾) Word and Light, and do not say a man is God. Islam can agree that a messenger brings the Word. Muslims hold that the Qur'an is God's (﷾) own speech, so they understand the idea of a Word that is His. What separates the two is which words are His, and the Qur'an asks to be tested on that (2:23; 4:82). And no man who brings the Word is one with God (18:110).
Where it lands — In Islam the messenger is a man sent by God (﷾), never one with Him (18:110; 112). Which words are God's (﷾) is decided by testing (2:23; 4:82).
Guru Granth Sahib, Ang 724 — Raga Tilang, Guru Arjan
“Why should they who adore Thee day and night go to hell?”
Cited for
If Allah is the same God, why does Islam say Sikhs go to hell? Guru Arjan himself asks why one who worships God day and night should go there.
The response
It is a fair question. Islam does not pass sentence on any person; that judgement is God's (﷾). The Qur'an teaches that no one is punished until a message has reached him. It also says that once it has, God (﷾) accepts no way but Islam from him (3:85). That is why Islam asks you to weigh the message.
Where it lands — No one is punished before a message reaches him (17:15). Once it has, Islam asks you to weigh it (3:85).
Guru Granth Sahib, Ang 1 — Jap, Guru Nanak (the Mul Mantar)
“There is but one God whose name is true, the Creator, devoid of fear and enmity, immortal, unborn, self-existent”
Cited for
Sikhs already worship the one Creator of the Mul Mantar. Nothing more is needed.
The response
That is a true start, and Islam welcomes it. The Qur'an records that the idol-worshippers of Mecca named Allah (﷾) as the Creator, and still called them to worship Him alone. The verse is not about Sikhs. It shows that the Qur'an asks more than naming the Creator: worship of Him by the names He gave and in the way He taught. Which way He taught is the question of whose words are His. The page "Did God speak through the Sikh Gurus?" takes it up.
Where it lands — Naming and describing the Creator is the start. Islam asks that He be worshipped by the names He gave and in the way He taught.
Perspectives
Sikh teaching
Sikhs worship one Creator, Ik Onkar, the God of the Mul Mantar. The Guru Granth Sahib names Him in the speech of the Muslims as well, and speaks of His Light in all things.
The Mul Mantar teaches one Creator who is without fear or enmity, immortal, unborn and self-existent.
Rebuttal
Granted, and the Qur'an says the same: Allah (﷾) is One, not begotten (112), and the Creator (42:11). But the Qur'an asks for more than the right description. It asks that He be worshipped as He Himself taught.
Guru Arjan calls God Allah and Khuda (Ang 724). He reports that people call Him Ram, Khuda, Gusain or Allah (Ang 885). So the name does not matter.
Rebuttal
Granted that the names are shared. The Qur'an itself says to call on Allah (﷾) or Rahman (17:110). But these are His own names, and He tells us to call on Him by them (7:180).
The Light of God is in everything (Ang 13), so God is near to every person.
Rebuttal
Islam also says He is near: "I am indeed close", and He is with you wherever you are. But He is firmly established on the Throne, and nothing is like Him.
Guru Arjan writes that the Guru and the Transcendent Lord are One (Ang 864).
Rebuttal
If "the Guru" here is God's (﷾) Word, Islam agrees that God's (﷾) Word is His own. The question is which words are His, and the Qur'an offers a test of its claim. If it means a man, the Qur'an's messenger says he is a man like his hearers.
Guru Arjan asks why one who worships God day and night should go to hell (Ang 724). So worshippers of the one God are safe.
Rebuttal
It is a fair question. Islam does not pass sentence on any person, and the Qur'an says none is punished until a message has reached him. It also says that once it has, God (﷾) accepts no way but Islam from him.
The Islamic perspective
The Mul Mantar and Surat al-Ikhlas both describe one God (﷾) who is not born. Islam adds that nothing is like Him and that a messenger is a man, never one with God (﷾). He is to be worshipped by the names He gave Himself, and as He taught. Belief and worship go together as one way of life.
The Mul Mantar and Surat al-Ikhlas both describe one God (﷾) who is not born.
The Qur'an says God (﷾) is with you wherever you are, and is firmly established on the Throne. It says nothing is like Him.
Muslim scholars reject any claim that God (﷾) dwells in His creation or is united with it.
The Qur'an has its messenger say he is a man like his hearers. It teaches that God (﷾) has no partner in His being.
The Most Beautiful Names belong to Allah (﷾), and He tells us to call on Him by them.
Naming the Creator is the start. The Qur'an asks that He be worshipped as He taught, through the messenger He sent.
No one is punished until a message has reached him.