When speaking on Islam or introducing Islam at various venues it is very common to face the question: Did Islam spread by the sword? Sometimes it is phrased as a question and sometimes as the more familiar embedded accusation in the middle of another question or comment, "but Islam spread by the sword..."
There are different ways to answer this question. One way, which is the typical Muslim response, which is correct, is to say, "No. Islam did not spread by the sword." Usually this is followed up by the example of Southeast Asia where Islam spread largely through commerce and regular interactions. This answer focuses on the question of the adoption of the faith itself by individuals.
Another way, which is typical for those who look negatively towards Islam, is to say, "Yes. It did spread by the sword. They are commanded by their faith to forcibly convert people to their faith and have done so throughout history." This answer focuses on the empire that was inspired by Islam rather than individuals themselves.
The full answer lies in between these two approaches. In this approach Islam did spread by the sword, but it also did not, and it depends what we mean by Islam.
It is well-known that the state that was governed by the teachings of Islam (starting in the 7th century a.d.) spread very quickly after the death of the Prophet Muhammad (pbuh). In the span of a century the empire had spread from Arabia to parts of North Africa, the Mediterranean, Central Asia, and even Spain. This spread is why we can say that Islam spread by the sword in one way. This, however, does not represent the spread of the faith itself though, rather it represents the spread of the empire that was inspired by the faith.
In the map above the dark red represents the expansion during the life of Muhammad from 622-632. The red color represents the expansion under the Rightly Guided Caliphs from 632-661. The yellow color represents the expansion under the Umayyad Dynasty from 661-750.
The spread of the empire, however, did not necessarily represent the faith of the individuals who lived under its rule. The faith itself categorically did not spread by the sword. A great evidence of this is to look at the spread of the faith itself in the region of Iraq. Starting from around 25 years after the death of Muhammad (pbuh) and lasting for several centuries, the capital of Islam was in the Greater Iraq region. Richard Bulliet of Columbia University discusses this in his book "Conversion to Islam in the Medieval Period." He argues that in a place like Greater Iraq, Muslims were not the majority until some 250-300 years after the death of the Prophet Muhammad (pbuh). Dr. Sherman Jackson says about this in his article, "Muslims as a Marginal Minority in America":
"By the year 150/767, for example, Muslims in greater Iraq numbered roughly 15-20 percent. By 250/864, they had reached 35 to 40 percent. Only after the passage of almost 300 years would Iraq be well over 50 percent Muslim. And it was not until roughly the year 350/961 that the Muslim population reached upwards of 75 percent."
This is a truly staggering statistic, that I would guess most Muslims have no awareness about, which proves without a doubt that Islam did not spread by the sword. If this was the way that non-Muslims were dealt with in the heart of the Islamic Empire it is indicative of the way they were dealt with in other areas as well, at least as a general policy.
So based on the above we can say to the question that the empire that was inspired by Islam did spread by the sword, as was customary in world politics at that time, but the actual faith itself did not.