Military officials said some 20,000 troops in the army and about 5,000 from the navy and air force had been taken off the books of their respective units in line with an overhaul of the security forces.
The government has in recent months freed thousands who had been jailed for deserting the military.
"The idea is to get the deserters off our books and make way for new recruits," a military official said. "Otherwise we carry a large number of deserters in our files.
"
He said the men were being taken off the payroll and would not be subjected to usual court martial proceedings.
The clean-up comes after government forces defeated the Tamil Tiger separatists in May following decades of bloody ethnic conflict.
Even though fighting has ended, the military still wants to recruit new troops to fill vacancies and to be deployed in areas of the north and east captured from the Tamil rebels.
Sri Lanka is still, however, holding 250,000 Tamils who have been detained in camps since