This calculator helps you determine the minimum required dimensions for an egress window to comply with building codes. An egress window is a window that is large enough for a person to escape through in an emergency, such as a fire. Building codes typically specify minimum clear opening width, height, and a maximum sill height from the floor.
function calculateEgress() {
var minClearWidth = parseFloat(document.getElementById("minClearWidth").value);
var minClearHeight = parseFloat(document.getElementById("minClearHeight").value);
var maxSillHeight = parseFloat(document.getElementById("maxSillHeight").value);
var windowWidth = parseFloat(document.getElementById("windowWidth").value);
var windowHeight = parseFloat(document.getElementById("windowHeight").value);
var windowSillHeight = parseFloat(document.getElementById("windowSillHeight").value);
var resultDiv = document.getElementById("result");
var complianceMessages = [];
if (isNaN(minClearWidth) || minClearWidth <= 0 ||
isNaN(minClearHeight) || minClearHeight <= 0 ||
isNaN(maxSillHeight) || maxSillHeight <= 0 ||
isNaN(windowWidth) || windowWidth <= 0 ||
isNaN(windowHeight) || windowHeight <= 0 ||
isNaN(windowSillHeight) || windowSillHeight = minClearWidth) {
complianceMessages.push("Window width meets or exceeds the minimum clear opening width requirement.");
} else {
complianceMessages.push("Window width is LESS than the minimum clear opening width requirement. Required: " + minClearWidth + " inches, Actual: " + windowWidth + " inches.");
}
if (windowHeight >= minClearHeight) {
complianceMessages.push("Window height meets or exceeds the minimum clear opening height requirement.");
} else {
complianceMessages.push("Window height is LESS than the minimum clear opening height requirement. Required: " + minClearHeight + " inches, Actual: " + windowHeight + " inches.");
}
// Check sill height
if (windowSillHeight <= maxSillHeight) {
complianceMessages.push("Window sill height is within the maximum allowed from the floor.");
} else {
complianceMessages.push("Window sill height is GREATER than the maximum allowed from the floor. Maximum allowed: " + maxSillHeight + " inches, Actual: " + windowSillHeight + " inches.");
}
var outputHTML = "