Contract Completion / Employer Termination
Resignation by Employee
Service Duration:–
Base Entitlement:–
Entitlement Percentage:–
Total Gratuity:–
Guide to KSA End of Service Benefits (ESB)
The End of Service Benefit (Gratuity) is a mandatory financial right for employees in Saudi Arabia upon the termination of their employment contract. It is governed by the Saudi Labor Law and serves as an appreciation for the employee's service period.
Note: The calculation is typically based on the last full wage received, which generally includes the basic salary plus housing and transportation allowances, unless specified otherwise in internal bylaws that don't contradict the labor law.
How is Gratuity Calculated in Saudi Arabia?
Under Article 84 of the Saudi Labor Law, the general rule for calculating the End of Service Award is:
First 5 Years: Half a month's salary for each year.
Following Years: One full month's salary for each year following the first five.
The calculation is prorated for fractions of a year (months and days).
Impact of Resignation (Article 85)
If the employee resigns (ends the contract voluntarily), the entitlement is reduced based on the years of service:
Less than 2 years: No gratuity entitlement.
2 years to less than 5 years: Entitled to one-third (1/3) of the award.
5 years to less than 10 years: Entitled to two-thirds (2/3) of the award.
10 years or more: Entitled to the full award.
Fixed-Term vs. Indefinite Contracts
For Fixed-Term Contracts, if the contract expires and is not renewed by the employer, or if the employer terminates the contract without valid cause, the employee is entitled to the full award calculated as per Article 84. If an employee resigns during a fixed-term contract without valid cause, they may not be entitled to gratuity and might be liable for damages, though this calculator applies the Article 85 sliding scale for general estimation purposes.
Exceptions
Employees are entitled to the full award regardless of the resignation period in specific cases, such as leaving work due to force majeure, or female workers ending their contract within six months of marriage or three months of giving birth.
function calculateKSAGratuity() {
// 1. Get Inputs
var salaryInput = document.getElementById("ksaSalary").value;
var contractType = document.getElementById("contractType").value;
var reason = document.getElementById("reason").value;
var startDateInput = document.getElementById("startDate").value;
var endDateInput = document.getElementById("endDate").value;
// 2. Validate Inputs
if (!salaryInput || salaryInput <= 0) {
alert("Please enter a valid monthly salary.");
return;
}
if (!startDateInput || !endDateInput) {
alert("Please select both start and end dates.");
return;
}
var start = new Date(startDateInput);
var end = new Date(endDateInput);
if (end <= start) {
alert("End date must be after the start date.");
return;
}
var salary = parseFloat(salaryInput);
// 3. Calculate Service Duration in Years (Exact decimal)
// One year in KSA labor law is typically calculated based on the Gregorian calendar (365 days) unless Hijri is specified in contract.
// We calculate difference in milliseconds and convert to years.
var diffTime = Math.abs(end – start);
var diffDays = diffTime / (1000 * 60 * 60 * 24);
var yearsOfService = diffDays / 365; // Using 365 days for standard calculation
// Display duration
var fullYears = Math.floor(yearsOfService);
var remainingDays = Math.floor((yearsOfService – fullYears) * 365);
var months = Math.floor(remainingDays / 30);
var days = remainingDays % 30;
var durationText = fullYears + " Years, " + months + " Months, " + days + " Days";
// 4. Calculate Base Gratuity (Article 84)
// First 5 years = 0.5 salary * years
// After 5 years = 1.0 salary * years
var baseGratuity = 0;
if (yearsOfService <= 5) {
baseGratuity = yearsOfService * (salary / 2);
} else {
// First 5 years calculated at half salary
var firstFivePortion = 5 * (salary / 2);
// Remaining years calculated at full salary
var remainingYears = yearsOfService – 5;
var remainingPortion = remainingYears * salary;
baseGratuity = firstFivePortion + remainingPortion;
}
// 5. Apply Resignation Rules (Article 85) or Termination Rules
var finalGratuity = 0;
var entitlementPercent = "100%";
if (reason === "termination") {
// Full entitlement if terminated by employer or contract ends
finalGratuity = baseGratuity;
entitlementPercent = "100% (Full Entitlement)";
} else if (reason === "resignation") {
// Sliding scale based on service duration
if (yearsOfService = 2 && yearsOfService = 5 && yearsOfService < 10) {
finalGratuity = (baseGratuity * 2) / 3;
entitlementPercent = "66.66% (2/3 of Award)";
} else {
finalGratuity = baseGratuity;
entitlementPercent = "100% (10+ Years Service)";
}
}
// 6. Output Results
document.getElementById("durationDisplay").innerHTML = durationText;
document.getElementById("baseDisplay").innerHTML = formatCurrency(baseGratuity);
document.getElementById("percentDisplay").innerHTML = entitlementPercent;
document.getElementById("finalAmountDisplay").innerHTML = formatCurrency(finalGratuity);
document.getElementById("result-container").style.display = "block";
}
function formatCurrency(num) {
return "SAR " + num.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
}