.calculator__form .costsharing,
.calculator__form .results {
display: none;
}
.calculator__form p span {
display: inline-block;
line-height: 43px;
}
.calculator__form form input:not([type=checkbox]):not([type=radio]):not([type=submit]),
.calculator__form form textarea,
.calculator__form select {
width: 220px;
}
.calculator__form input#income {
width: 205px;
}
.calculator__form label {
font-weight: 700;
}
.calculator__form input[type=submit] {
width: auto;
}
.calculator__form dl {
display: grid;
grid-column-gap: 1em;
grid-row-gap: 0.25em;
grid-template-columns: [dt] max-content [dd] 1fr;
}
.calculator__form dt {
font-weight: 700;
grid-column-start: dt;
grid-column-end: dt;
padding-right: 1em;
}
.calculator__form dd {
margin: 0;
padding: 0;
grid-column-start: dd;
grid-column-end: dd;
}
Children under 18 (full-time education)
Children in undergraduate studies
Number of bedrooms
Monthly rent/mortgage
£
Spouse net annual income (after tax and national insurance)
£
Results
The grant would be awarded as follows:
Training Support Grant
£
Child and Housing Grants
Children under 18
£
Children in undergraduate
£
Housing grant
£
Utility grant
£
Cost sharing deduction
Spouse net income
£
Cost sharing threshold
£
Spouse net income above cost sharing threshold
£
Deduction amount
£
This calculation is based on a household with two people sharing and splitting housing costs equally.
If you are sharing with more than one person, your grant amount will need to be adjusted based on your
proportion of the total housing costs relative to the number of people sharing. For more information,
please contact Siân Trotman.
Total grant £
function calculate_grant(event) {
const form = event.target;
// User inputs
const children_under_18 = parseInt(form.querySelector("#children_under_18").value) || 0;
const children_undergrad = parseInt(form.querySelector("#children_undergrad").value) || 0;
const beds = parseInt(form.querySelector("#beds").value) || 0;
const monthlyRent = Math.min(parseInt(form.querySelector("#rent").value) || 0, 1250);
const income = parseInt(form.querySelector("#income").value) || 0;
// Constants
const TRAINING_GRANT = 10500;
const SHARING_THRESHOLD = 18346;
const MAX_GRANT = 36850;
// Child grants
let child_under_18_grant = 0;
const child_values = [4832, 4229, 3624];
// Children under 18
if (children_under_18 > 0) {
// For up to 3 children, add each child_values[i]; for more than 3, use the third figure repeatedly
child_under_18_grant += child_values
.slice(0, Math.min(3, children_under_18))
.reduce((sum, val) => sum + val, 0);
if (children_under_18 > 3) {
child_under_18_grant += (children_under_18 - 3) * child_values[2];
}
}
// Children in undergrad
let child_undergrad_grant = 0;
for (let i = 1; i <= children_undergrad; i++) {
let effectiveIndex = children_under_18 + i;
let grantRate;
if (effectiveIndex === 1) {
grantRate = child_values[0]; // First child rate
} else if (effectiveIndex === 2) {
grantRate = child_values[1]; // Second child rate
} else {
grantRate = child_values[2]; // Subsequent children rate
}
child_undergrad_grant += grantRate / 2;
}
// Housing and utility grants (direct vs. indirect costs)
let housing_grant = 0;
let utility_grant = 0;
const housing_values = {1: 2607, 2: 2607, 3: 3583, 4: 4668};
// Direct housing costs (rent capped at £1250/month -> annual)
housing_grant = monthlyRent * 12;
// Indirect housing costs based on bedrooms
utility_grant = housing_values[Math.min(beds, 4)] || 4668;
// Cost sharing deduction
let cost_sharing = 0;
if (income > SHARING_THRESHOLD) {
cost_sharing = (income - SHARING_THRESHOLD) * 0.5;
}
// Calculate total
let total = TRAINING_GRANT +
child_under_18_grant +
child_undergrad_grant +
housing_grant +
utility_grant -
cost_sharing;
// Respect maximum grant limit
total = Math.min(total, MAX_GRANT);
// Update results in the DOM
form.querySelector("#grant").textContent = TRAINING_GRANT.toLocaleString();
form.querySelector("#child_under_18").textContent = child_under_18_grant.toLocaleString();
form.querySelector("#child_undergrad").textContent = child_undergrad_grant.toLocaleString();
form.querySelector("#housinggrant").textContent = housing_grant.toLocaleString();
form.querySelector("#utilitygrant").textContent = utility_grant.toLocaleString();
// Cost sharing fields
form.querySelector("#spousenetincome").textContent = income.toLocaleString();
form.querySelector("#costsharingthreshold").textContent = SHARING_THRESHOLD.toLocaleString();
form.querySelector("#sharingdifference").textContent = Math.max(0, income - SHARING_THRESHOLD).toLocaleString();
form.querySelector("#fiftypercent").textContent = cost_sharing.toLocaleString();
// Total
form.querySelector("#total").textContent = total.toLocaleString();
// Reveal results
form.querySelector(".results").style.display = "block";
form.querySelector(".costsharing").style.display = "block";
}