PurposeReligious doctrines generally encourage people to behave ethically. However, in daily life, individuals notice inconsistencies between religious beliefs and behavior, leading them to ask, in the context of commerce, why religious consumers would behave unethically. The purpose of this study was to investigate the impact of consumers' intrinsic and extrinsic religiosity on their ethical behavior. Specifically, the moderating effect of ethical ideology on the relationship between Indonesian consumers' religiosity and their ethics was examined by means of a survey.Design/methodology/approachThe data derived from the questionnaire were complemented by convenience samples of Indonesians living in Daerah Istimewa Yogyakarta (DIY) in central Java. The researchers distributed 600 questionnaires in two major shopping malls and several housing areas in the region, of which 467 were completed and returned, for an overall response rate of 77.8%.FindingsThe results indicated that the participants' intrinsic religiosity negatively impacted their ethical beliefs and was mediated by their idealistic ethical ideology. The present study also found that idealism had negative effects on three of the four dimensions of the consumer ethics scale (CES) (actively benefiting, passively benefiting and questionable behavior), while relativism had positive effects on two of the dimensions (passively benefiting and questionable behavior.Research limitations/implicationsOne limitation of the present study was that the analysis did not distinguish among the religions practiced by the respondents to the questionnaire.Originality/valueThis is one of the first few studies investigating the mediating role of ethical ideology in a religious society. This study contributes to the literature on these issues in theoretical and managerial terms by extending the Hunt-Vitell theory (1986) to the context of consumer ethics.