The formula, and the three things people get wrong
Gratuity for an employer covered by the Payment of Gratuity Act is fifteen divided by twenty-six, multiplied by your last drawn basic plus dearness allowance, multiplied by your completed years of service. Twenty-six is the assumed number of working days in a month - thirty days less four Sundays - and fifteen days' wages is the statutory entitlement for each year worked.
Three errors account for almost every wrong answer. The first is using gross salary or CTC instead of basic plus DA, which inflates the result by roughly two and a half times. The second is using 15/30 for a covered employer, which understates it by about thirteen per cent. The third is mishandling the part-year.