As of 2001[update] India census, Ajnala had a population of 18,602. Males constitute 55% of the population and females 45%. Ajnala has an average literacy rate of 68%, higher than the national average of 59.5%; with 58% of the males and 42% of females literate. 12% of the population is under 6 years of age.
During the Indian Rebellion of 1857, 282 sepoys of the 26th Native Infantry, who had mutinied at Lahore and subsequently surrendered believing they were going to be given a fair trial, were summarily executed without trial by Frederick Henry Cooper, then-Deputy Commissioner of the district. Cooper was a proud Christian of the "true English stamp and mould". The bodies were dumped into a deep dry well near the police station. The guard who shot the sepoys were made up entirely of Sikhs. In March 2014 the head of a local Sikh gurdwara announced that the remains of those buried had been uncovered in the excavation of a well within the shrine.