Ideal Weight Calculator
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
color: #333;
}
.calculator-container {
max-width: 1000px;
margin: 0 auto;
padding: 20px;
}
.panel2 {
background: #f5f5f5;
padding: 15px;
border-radius: 5px;
margin-bottom: 20px;
}
.topmenucenter {
text-align: center;
margin-bottom: 15px;
}
.topmenucenter ul {
list-style: none;
padding: 0;
margin: 0;
display: inline-block;
}
.topmenucenter li {
display: inline;
margin: 0 5px;
}
.topmenucenter a {
text-decoration: none;
color: #336699;
padding: 5px 10px;
}
.topmenucenter li#menuon a {
background: #336699;
color: white;
border-radius: 3px;
}
table {
width: 100%;
border-collapse: collapse;
}
table.cinfoT {
margin: 20px 0;
border: 1px solid #ddd;
}
table.cinfoT td, table.cinfoT th {
padding: 8px;
border: 1px solid #ddd;
}
table.cinfoT th {
background-color: #f2f2f2;
text-align: left;
}
.cinfoHd {
font-weight: bold;
background-color: #f2f2f2;
}
.cinfoHdL {
font-weight: bold;
background-color: #f2f2f2;
text-align: center;
}
input[type=”text”], input[type=”number”] {
padding: 5px;
border: 1px solid #ddd;
border-radius: 3px;
}
input[type=”submit”], input[type=”button”] {
background: #336699;
color: white;
border: none;
padding: 5px 15px;
border-radius: 3px;
cursor: pointer;
}
.h2result {
background: #336699;
color: white;
padding: 8px;
margin-top: 0;
}
.leftinput {
float: left;
width: 45%;
}
.rightresult {
float: right;
width: 50%;
}
#clear {
clear: both;
}
fieldset {
border: 1px solid #ddd;
padding: 10px;
margin: 20px 0;
}
legend {
font-weight: bold;
color: #336699;
}
Ideal Weight Calculator
The Ideal Weight Calculator computes ideal body weight (IBW) ranges based on height, gender, and age.
Result
The ideal weight based on popular formulas:
Formula Ideal Weight
Robinson (1983) –
Miller (1983) –
Devine (1974) –
Hamwi (1964) –
Healthy BMI Range –
Related
BMI Calculator |
Body Fat Calculator |
Calorie Calculator
How Much Should I Weigh?
Most everyone has at some point tried to lose weight, or at least known somebody who has. This is largely due to the perception of an “ideal” body weight…
Formulas for Finding the Ideal Weight
G. J. Hamwi Formula (1964)
Male: 48.0 kg + 2.7 kg per inch over 5 feet
Female: 45.5 kg + 2.2 kg per inch over 5 feet
function toggleUnits(unit) {
if (unit === ‘imperial’) {
document.getElementById(‘imperialUnits’).style.display = ‘block’;
document.getElementById(‘metricUnits’).style.display = ‘none’;
document.querySelectorAll(‘.topmenucenter li’)[0].id = ‘menuon’;
document.querySelectorAll(‘.topmenucenter li’)[1].id = ”;
} else {
document.getElementById(‘imperialUnits’).style.display = ‘none’;
document.getElementById(‘metricUnits’).style.display = ‘block’;
document.querySelectorAll(‘.topmenucenter li’)[0].id = ”;
document.querySelectorAll(‘.topmenucenter li’)[1].id = ‘menuon’;
}
}
function calculateIdealWeight() {
const age = parseInt(document.getElementById(‘age’).value);
const isMale = document.getElementById(‘male’).checked;
let heightInInches;
if (document.getElementById(‘imperialUnits’).style.display !== ‘none’) {
const feet = parseFloat(document.getElementById(‘feet’).value);
const inches = parseFloat(document.getElementById(‘inches’).value);
heightInInches = feet * 12 + inches;
} else {
const cm = parseFloat(document.getElementById(‘cm’).value);
heightInInches = cm / 2.54;
}
// Calculate based on different formulas
const hamwi = calculateHamwi(heightInInches, isMale);
const devine = calculateDevine(heightInInches, isMale);
const robinson = calculateRobinson(heightInInches, isMale);
const miller = calculateMiller(heightInInches, isMale);
const bmiRange = calculateBMIRange(heightInInches);
// Display results
document.getElementById(‘hamwi’).textContent = hamwi.toFixed(1) + ‘ kg’;
document.getElementById(‘devine’).textContent = devine.toFixed(1) + ‘ kg’;
document.getElementById(‘robinson’).textContent = robinson.toFixed(1) + ‘ kg’;
document.getElementById(‘miller’).textContent = miller.toFixed(1) + ‘ kg’;
document.getElementById(‘bmiRange’).textContent = bmiRange.min.toFixed(1) + ‘ – ‘ + bmiRange.max.toFixed(1) + ‘ kg’;
}
function calculateHamwi(heightInInches, isMale) {
const base = isMale ? 48 : 45.5;
const increment = isMale ? 2.7 : 2.2;
return base + (increment * (heightInInches – 60));
}
function calculateDevine(heightInInches, isMale) {
const base = isMale ? 50 : 45.5;
return base + (2.3 * (heightInInches – 60));
}
function calculateRobinson(heightInInches, isMale) {
const base = isMale ? 52 : 49;
const increment = isMale ? 1.9 : 1.7;
return base + (increment * (heightInInches – 60));
}
function calculateMiller(heightInInches, isMale) {
const base = isMale ? 56.2 : 53.1;
const increment = isMale ? 1.41 : 1.36;
return base + (increment * (heightInInches – 60));
}
function calculateBMIRange(heightInInches) {
const heightInMeters = (heightInInches * 2.54) / 100;
const min = 18.5 * heightInMeters * heightInMeters;
const max = 25 * heightInMeters * heightInMeters;
return { min, max };
}
function clearForm() {
document.getElementById(‘age’).value = ’25’;
document.getElementById(‘male’).checked = true;
document.getElementById(‘feet’).value = ‘5’;
document.getElementById(‘inches’).value = ’10’;
document.getElementById(‘cm’).value = ‘180’;
document.querySelectorAll(‘#result td’).forEach(td => {
if (!td.classList.contains(‘cinfoHd’) && !td.classList.contains(‘cinfoHdL’)) {
td.textContent = ‘-‘;
}
});
}
Like this: Like Loading...
Related