Irreligion in Iran has a long historical background, non-religious citizens are officially unrecognized by the Iranian government. In official 2011 census, 265,899 persons did not state any religion (0.3% of total population). However, according to a 2020 online survey by Gamaan found a much larger percentage of Iranians identifying as atheist (5.8%), and a large fraction (9.2%) identifying as not following an organized religion.
 Under Iranian law, apostasy from Islam is punishable by death. Non-religious Iranians are officially unrecognized by the government, and one must declare oneself as a member of one of the four recognized faiths in order to avail oneself of many of the rights of citizenship. Citizens of the Islamic Republic of Iran are officially divided into four categories: Muslims, Zoroastrians, Jews and Christians.  This official division ignores other religious minorities in Iran, notably the agnostics, atheists and Bahá'ís.
 The oldest document referring to atheists in Iran, dates back to Zoroaster era where in Avesta, they are referred to as "Ashmoghs", which literally means heretics, apostates, or more precisely atheists.
 In Islamic Iran there were also instances of opposition to organised religion. In the 10th century AD, the famous Persian scientist Rhazes famously opposed religion and the divine revelation of prophets in his treatises Fī al-Nubuwwāt (On Prophecies) and Fī Ḥiyal al-Mutanabbīn (On the Tricks of False Prophets).
 Further skepticism of the ideas of God could be seen in the quatrains of Omar Khayyam where the compassion of God and the ideas of afterlife are continuously questioned. This work was also written in the 10th century.
 Under the Pahlavi dynasty from 1925 until the Iranian Islamic revolution of 1979,  atheism was tolerated though not officially accepted. With the Bolshevik Revolution in Russia (the northern neighbour of Iran), the Iranian communist  Tudeh Party enjoyed considerable popularity among educated urban Iranians especially in the late 1940s and 1960s, and atheism (a tenet of Marxism–Leninism) grew in popularity. For example, Karo Derderian, the Armenian-Iranian poet and brother to the famous singer Viguen, famously wrote poetry rejecting both God and religion.
 Even when atheism was tolerated by the Iranian governments,  the vast majority of people in Iran have remained religious. However, with the Islamic revolution,  irreligion became a political issue, and a disorder to be suppressed by Muslims.
 Mehdi Bazargan wrote that "to  view Islam as an opposition to Iranian nationalism is tantamount to destroying ourselves. To deny Iranian identity and consider nationalism irreligious is part and parcel of the anti-Iranian movement and is the work of the anti-revolutionaries".
 According to the Ali Reza Eshraghi, The problem with today's Iranian society is that few political or religious critics are willing to recognise or understand the “popular religion.” In other words, both the Islamic regime and its opposing elites are not fond of the manners in which the laymen practice religion. Therefore, instead of relying on empirical observation they prefer to simply speculate about the religiosity of this very complex society. Measuring religiosity is not a simple task. The criteria are different among the social scientists. In 2012 only, Iranian scholars held thirteen sessions in Tehran to discuss the criteria.The limited research on this matter suggests that Iranian society is still a religious one. A study in 2009, conducted by two Iranian sociologists – Abbas Kazemi and Mehdi Faraji – conclude that in comparison to 1975, four years before the revolution, Iranians are still considerably very religious. The number of Iranians who pray or participate in socio-religious rituals has remained relatively unchanged. The number of people who fast has even increased.At the same time, as another sociologist Amir Nikpey says, Iranians have become modern and secular “without becoming anti-religion.”.
 Some Iranian feminists have also been noted as being irreligious and atheistic.
 Patriotic Iranian youth who fought and died in the Iran-Iraq War were often lacking in Islamic religious zeal, government mythology notwithstanding, and the Iranian youth are among the most politically active among the countries of the Islamic world. As the most restive segment of Iranian society, the young also represent one of the greatest long-term threats to the current form of theocratic rule. After the 2009 presidential election, youth was the biggest bloc involved in the region's first sustained “people power” movement for democratic change, creating a new political dynamic in the Middle East. Iran is one of the most tech-savvy societies in the developing world, with an estimated 28 million Internet users, led by youth. Most young Iranians are believed to want to be part of the international community and globalization.
 Iran was reported by The Washington Post to be among the thirteen countries where atheism can attract capital punishment. The last noted legal execution for apostasy in Iran was in 2014, when Mohsen Amir-Aslani was convicted and executed for making "innovations in religion" and insulting the Prophet Jonah. Others, such as Youcef Nadarkhani, Saeed Abedini have been recently harassed, jailed and sentenced to death for apostasy.
 According to Harvard University professor Robert D. Putnam, the average Iranian-American is slightly less religious than the average American. In the book, Social Movements in 20th Century Iran: Culture, Ideology, and Mobilizing Frameworks, author Stephen C. Poulson adds that Western ideas are making Iranians irreligious.
 Nearly as many Iranian Americans identify as irreligious as Muslim, and a full one-fifth are Christians, Jews, Baháʼís, or Zoroastrians. Additionally, the number of Muslim Iranian-Americans decreased from 42% in 2008 to 31% in 2012.
 The Central Committee for Ex-Muslims was founded by Dutch-Iranian Ehsan Jami with an aim to support apostates and to bring attention to women's rights violations.
 A British-Iranian organisation, “Iranian Atheists Association”, has been established in 2013 to form a platform for Iranian atheists to start debate and question the current Islamic republic’s attitude towards atheists, apostasy and human rights. A significant number of Iranians abroad, especially Iranian-Americans, are irreligious, agnostic or atheist.