Islam is thought to have first been adopted by peoples of the Indonesian archipelago during the eleventh century, although Muslims had visited the archipelago early in the Muslim era. By the end of the 16th century, Islam, through conversion, had surpassed Hinduism and Buddhism as the dominant religion of the peoples of Java and Sumatra. At this time, only Bali retained a Hindu-practising majority, and the eastern islands remained largely animist but would adopt Islam and Christianity in the seventeenth and eighteenth centuries.
The spread of Islam was driven by increasing trade links outside of the archipelago; in general, traders and the royalty of major kingdoms were the first to adopt the new religion. Dominant kingdoms included Mataram in Central Java, and the sultanates of Ternate and Tidore in the Maluku Islands to the east. By the end of the thirteenth century, Islam had been established in North Sumatra; by the fourteenth in northeast Malaya, Brunei, the southern Philippines and among some courtiers of East Java; and the fifteenth in Malacca and other areas of the Malay Peninsula. Although it is known that the spread of Islam began in the west of the archipelago, the fragmentary evidence does not suggest a rolling wave of conversion through adjacent areas; rather, it suggests the process was complicated and slow.
Despite being one of the most significant developments in Indonesian history, historical evidence is fragmentary and generally uninformative such that understandings of the coming of Islam to Indonesia are limited; there is considerable debate amongst scholars about what conclusions can be drawn about the conversion of Indonesian peoples. The primary evidence, at least of the earlier stages of the process, are gravestones and a few travelers accounts, but these can only show that indigenous Muslims were in a certain place at a certain time. This evidence cannot explain more complicated matters such as how lifestyles were affected by the new religion or how deeply it affected societies. It cannot be assumed, for example, that because a ruler was known to be a Muslim, that that the process of Islamisation of that area was complete; rather the process was, and remains to this day, a continuous process in Indonesia