The caste system in India is the paradigmatic ethnographic instance of social classification based on castes. It has its origins in ancient India, and was transformed by various ruling elites in medieval, early-modern, and modern India, especially the Mughal Empire and the British Raj. It is today the basis of affirmative action programmes in India as enforced through its constitution. The caste system consists of two different concepts, varna and jati, which may be regarded as different levels of analysis of this system.
The caste system as it exists today is thought to be the result of developments during the collapse of the Mughal era and the rise of the British colonial government in India. The British Raj furthered this development, making rigid caste organisation a central mechanism of administration. Between 1860 and 1920, the British incorporated the Indian caste system into their system of governance, granting administrative jobs and senior appointments only to Christians and people belonging to certain castes. Social unrest during the 1920s led to a change in this policy. Caste was no longer used by the colonial authority to functionally organize civil society. This reflected changes in administrative practices, understandings of expertise, and the rise of new European scholarly institutions. After the 1920s, the colonial administration began a policy of positive discrimination by reserving a certain percentage of government jobs for the lower castes. In 1948, negative discrimination on the basis of caste was banned by law and further enshrined in the Indian constitution in 1950; however, the system continues to be practiced in parts of India. There are 3,000 castes and 25,000 sub-castes in India, each related to a specific occupation.
Caste-based differences have also been practised in other regions and religions in the Indian subcontinent, like Nepalese Buddhism, Christianity, Islam, Judaism and Sikhism. It has been challenged by many reformist Hindu movements, Sikhism, Christianity, and present-day Indian Buddhism.