Islam is the second largest religion in the United Kingdom, with results from the 2011 Census giving the total population as 2,786,635, or 4.4% of the total UK population, while the 2021 Census results released so far () show a population of 3,868,133 (6.5%) in England and Wales, 3,801,179 in England and 66,950 in Wales. The 2011 census reported 76,737 Muslims in Scotland (1.45%). London has the greatest population of Muslims in the country. The vast majority of Muslims in the United Kingdom adhere to Sunni Islam, while smaller numbers are associated with Shia Islam.
During the Middle Ages, there was some general cultural exchange between Christendom and the Islamic world. Nonetheless, there were no Muslims in the British Isles; however, a few Crusaders did convert in the East, such as Robert of St. Albans. During the Elizabethan age, contacts became more explicit as the Tudors made alliances against Catholic Habsburg Spain, including with Morocco and the Ottoman Empire. As the British Empire grew, particularly in India, Britain came to rule territories with many Muslim inhabitants; some of these, known as the lascars, are known to have settled in Britain from the mid-18th century onwards. In the 19th century, Victorian Orientalism spurred an interest in Islam and some British people, including aristocrats, converted to Islam. Marmaduke Pickthall, an English writer and novelist, and a convert to Islam, provided the first complete English-language translation of the Qur'an by a British Muslim in 1930.
Under the British Indian Army, a significant number of Muslims fought for the United Kingdom during the First and the Second World Wars (a number of whom were awarded the Victoria Cross, Britain's highest honour). In the decades following the latter conflict and the Partition of India in 1947, many Muslims (from what is today Bangladesh, India and Pakistan) settled in Britain itself. To this day, British Asians constitute the majority of Muslims in Britain in terms of ethnicity, although there are significant Turkish, Arab and Somali communities, as well as up to 100,000 British converts of multiple ethnic backgrounds.