Irreligion in China

China has the world's greatest irreligious population, and the Chinese government and the ruling Communist Party of China is officially atheist. Despite limitations on certain forms of religious expression and assembly, religion is not banned, and religious freedom is nominally protected under the Chinese constitution. Among the general Chinese population, there are a wide variety of religious practices. The Chinese government's attitude to religion is one of skepticism and non-promotion.
According to a 2012 Gallup poll, 47% of Chinese people were convinced atheists, and a further 30% were not religious. In comparison, only 14% considered themselves to be religious. More recently, a 2015 Gallup poll found the number of convinced atheists in China to be 61%, with a further 29% saying that they are not religious compared to just 7% who are religious.
Since 1978, the constitution provides for religious freedom: "No state organ, public organization or individual may compel citizens to believe in, or not to believe in, any religion; nor may they discriminate against citizens because they do, or do not believe in religion" (article 36). The Chinese state officially recognizes five religions: Buddhism, Taoism, Islam, Catholicism, and Protestantism.
History.
While in modern history, the Taiping Rebellion, Boxer Rebellion, Communist Revolution, and the Cultural Revolution contributed significantly to the rise of irreligion and distrust of organized religion among the general populace; irreligion in its various forms, especially rationalism, secularism, and antitheism, has had a long history in China dating back millennia. The Zhou Dynasty "Classic of Poetry" contains several catechistic poems in the "Decade of Dang" questioning the authority or existence of "Shangdi". Later philosophers such as Xun Zi, Fan Zhen, Han Fei, Zhang Zai, Wang Fuzhi also criticized the religious practices prevalent during their times. Buddhism flourished in China during the Southern and Northern Dynasties Period. It was during this period that Fan Zhen wrote "Shen Mie Lun" (Simplified Chinese 神灭论, Traditional Chinese 神滅論, "On the Annihilation of the Shen") in reaction to Buddhist concepts of body-soul dualism, "samsara" and "karma". He wrote that the soul is merely an effect or function of the body, and that there is no soul without the body (i.e., after the destruction and death of the body). Further, he considered that cause-and-effect relationships claimed to be evidence of "karma" were merely the result of coincidence and bias. For this, he was exiled by the Emperor.
Confucianism as a state-instituted philosophy has flourished in China since the Han Dynasty, and the opportunities it offered was another fundamental origin of atheism in China. While there were periods in which Taoism and Buddhism may have been officially promoted, the status of Confucianism in Chinese society had rarely been challenged during imperial times. Extensive study of the Confucian Classics was required to pass the Imperial Civil Service Examinations, and this was the major (and often sole) means by which one could achieve prominence in society. Confucianism places particular emphasis on humanistic and this-worldly social relations, rather than on an otherworldly soteriology. This produced a cultural tendency that facilitated acceptance of modern forms of irreligion such as humanism, secularism, and atheism.
Zhu Xi, one of the most important Confucian philosophers, encouraged an agnostic tendency within Confucianism, because he believed that the Supreme Ultimate was a rational principle, and he discussed it as an intelligent and ordering will behind the universe (while stating that "Heaven and Earth have no mind of their own" and promoting their only function was to produce things. Whether this can be considered a conscious or intelligent will is clearly up to debate). 
China is considered to be a nation with a long history of humanism, secularism, and this-worldly thought since the time of Confucius, who stressed "shisu" (世俗 "being in the world"). Hu Shih stated in the 1920s that "China is a country without religion and the Chinese are a people who are not bound by religious superstitions."
In the 19th century, after China's defeat in the First Opium War and in successive wars, the country succumbed to increasing domination by foreign imperialist powers. The Boxers (or the "Yihetuan") considered Christian missionaries as promoting foreign influence in China and held deep anti-Christian views. Orthodox, Catholic and Protestant missionaries and church members were massacred.
In the 1920s, the Anti-Christian Movement (非基督教运动) was an intellectual and political movement in Republican China. The May Fourth Movement for a New Culture attacked religion of all sorts, including Confucianism and Buddhism as well as Christianity, rejecting all as superstition. The various movements were also inspired by modernizing attitudes deriving from both nationalist and socialist ideologies, as well as feeding on older anti-Christian sentiment that was in large part due to repeated invasions of China by Western countries. 
During the Cultural Revolution, a radical policy of anti-religion and anti-tradition was instituted. In the ensuing decade, the five major religions in China were severely suppressed. Many religious organizations were disbanded, property was confiscated or damaged, monks and nuns were sent home (or killed in violent struggle sessions).
Since the reforms of 1979, the government has liberalized religious policies to a degree, and the religious population has experienced some growth. Nevertheless, the irreligious remain the majority among all age groups in China. Local governments may even support certain local religious institutions and festivals in a bid to promote tourism. However, atheism, characterization of religions as superstition, and promotion of scientific materialism remain core tenets of the ruling Communist Party.