This question is the question posed for a debate, one that sharply divided Sam Harris and Maajid Nawaz, though they later reconnected and became friends and allies. There is an excellent podcast introducing their collaboratively-written book on Sam Harris' website. When they discuss their first meeting, they reference the debate that began their dialogue.
The question posed for debate at that event was: Is Islam a religion of peace or a religion of war? Maajid Nawaz rightly thought this was not a very fair question, that it proposed a false dilemma between two poles while ignoring the immense space available to stand in between them.
It's not a simple thing to assess a religion (as distinct from the cultures in which it functions and the political and economic structures in those cultures) in such a way as to accurately answer the question of whether it is inherently a religion of war or a religion of peace in most cases. Unless the religion in question is the cult of Ares the God of War or an explicitly pacifistic religion like Jainism, the answer to the question won't be completely obvious and easy to sort out.
And given the normal human capacity for acting in a way that ignores their explicit beliefs, it's entirely possible that even an explicitly pacifistic religion or a religion which worships a deity of war might have members which are extremely violent and extremely peaceful, respectively. The line from belief to lifestyle is far from straight and smooth in many cases. In light of these difficulties, how can we even begin to answer such a question?
Many Westerners who were shaped by some form of Protestant Christianity in their upbringing (of which I am one) and therefore shaped by the doctrine of sola scriptura, tend to want to look at the texts of a religious tradition first as a way of understanding it. That's not a bad place to start: it tells us something important about the explicit beliefs of the religion, at least in cases in which the sacred text is meant to establish the explicit beliefs of the religion, which is sometimes the case and sometimes not the case.
I agree with Sam Harris that we can't ignore the role that specific religious beliefs play in shaping the behavior of religious adherents. His opponents on what he and Nawaz call the "regressive left" cannot seem to believe that not at religious people are rank hypocrites, that there are many who sincerely try to live by the teachings of their religion as they understand them. His fairly uncontroversial claim (uncontroversial to ISIS at least) that the violence of ISIS flows directly from the teachings of Islam is responded to by many of his fellow secularist liberals with charges that he is an anti-Muslim bigot.
Sam Harris just has a perfectly normal post-Christian Westerner's tendency to actually read the texts of a religion (in the case of Islam, the Quran and hadith) and enough respect for devoutly religious people to assume that they take them seriously. And what happens when we use text analytics software to look at the primary texts of Judaism, Christianity, and Islam is that we find out that the Tanakh has far more violence in it than the Quran, and that the violence levels in the New Testament and the Quran are very close.
But this doesn't get us very far toward answering even the only somewhat useful question of which religion is a religion of war, because the literary forms just aren't comparable. The Tanakh has a history of the building of the Israelite kingdom, and the Quran does not contain a set of books of comparable length about the building of the Islamic caliphate by Muhammed and his companions. If it did, the references to violence in the Quran would be far higher, and I'm not sure which way it would come out.
So if we can't answer the question based on religious texts, can we look at the history of violence performed by the members of those religions? Well, even if we suppose that we could agree upon a fair metric that took into account the age of those religions so that we could control for the length of time their adherents had to rack up a body count, how could we gather enough evidence to demonstrate that one religion was a religion of war and the other a religion of peace? Do we really want to convict a religion of being more warlike on the basis of it having preserved more written records of its violent adherents?
Or do we want to assume that a lack of written records means that religion's adherents have been so successful in their violent acts that no records survived the unspeakable events? Or in the other direction, that a lack of records of violent acts means that religion's adherents have been consistently peaceful? Or do we stop looking at history and just look at what a religion's adherents are doing now as if that were necessarily a good indication of what the religion as a whole is about?
It is a far more difficult thing to answer the question of whether a religion is one of peace or one of war than either its friends or enemies would like to admit. Its friends are inclined to say that it is peaceful regardless of the evidence, and its enemies are inclined to say that it is violent regardless of the evidence. As someone who was glad to pray with my Muslim brothers, I count myself as a friend to Muslims.
Nonetheless, I don't think it is easy to claim that Islam is straightforwardly a religion of peace any more than I think it is easy to claim that my own religion is straightforwardly a religion of peace. It is certainly the case that the vast majority of Muslims worldwide are not interested in going to war and want to just live their lives without conquering their neighbors, though some of the ones who are so inclined seem to very serious about Islamic theology and practice. That is also generally the case with members of my religion.
And unlike members of my religion, Muslims have a duty to support the formation of a global religious government. In the letter from many Sunni scholars across the Muslim world condemning the actions of ISIS, it becomes clear that there is widespread agreement that all Muslims should help form the caliphate and establish it everywhere. There are certainly differences of opinion about whether violence is the best way to establish the global caliphate, and thankfully the current consensus among Muslims seems to be that violence is not the best way to do so.
While there are certainly liberal Muslims who want to reform Islam and live in secular societies not dominated by Islamic sharia, it's fairly clear that mainstream Islam is, like most religions of the ancient world, not a religion that can be easily separated from political structures. Many ancient religions, including Judaism which influenced Islam, were inextricably linked to a tribal or nationalistic political ideology, and Islam is no exception to this.
There is probably no good way to determine whether or not any particular religion is a religion of peace or a religion of war, but it's obviously the case that when religions become closely entangled with the state, it then becomes difficult to avoid the perception that it is the religion as much as the state which goes to war. This has been true of all religions which become entangled with governments, not just Islam.
In the end, I have to agree with Maajid Nawaz that Islam is neither a religion of peace nor a religion of war; it's simply a religion, and it is the adherents of that religion who decide how their behavior is shaped by the doctrines of the religion. Thankfully, the majority of Muslims have decided that it is not a religion of war and have acted accordingly, following their conscience and the teachings of Muhammed to a more peaceful destination.