What is your Body Mass Index (BMI)?
Sep 15, 2023
v.0
Calculate your Body Mass Index (BMI) to determine if you are underweight, normal weight, overweight, or obese. Calculator Bmi Body mass index Weight Height

Versions  

Bugs  
None!

Get This App On Your Website

1. Copy the code above with the iframe and link.
2. Paste the code into your website.
3. Resize the iframe to fit your website.

Javascript, HTML, CSS Code

                [
{
"search": "// Event listeners\n $(\"#unit-select\").change(function() {\n selectedUnit = $(this).val();\n\n if (selectedUnit) {\n hideErrorMessage();\n showInputFields(selectedUnit);\n // Add code to updateInputLabels\n if (selectedUnit === METRIC) {\n $(\"#height-input-label\").text(\"Height (cm)\");\n $(\"#weight-input-label\").text(\"Weight (kg)\");\n } else if (selectedUnit === IMPERIAL) {\n $(\"#height-input-label\").text(\"Height (ft/in)\");\n $(\"#weight-input-label\").text(\"Weight (lbs)\");\n }\n } else {\n hideInputFields();\n }\n });",
"replace": "// Event listeners\n $(\"#unit-select\").change(function() {\n selectedUnit = $(this).val();\n\n if (selectedUnit) {\n hideErrorMessage();\n showInputFields(selectedUnit);\n // Add code to updateInputLabels\n if (selectedUnit === METRIC) {\n $(\"#height-input-label\").text(\"Height (cm)\");\n $(\"#weight-input-label\").text(\"Weight (kg)\");\n } else if (selectedUnit === IMPERIAL) {\n $(\"#height-input-label\").text(\"Height (ft)\");\n $(\"#height-input-inches-label\").removeClass(\"d-none\");\n $(\"#weight-input-label\").text(\"Weight (lbs)\");\n }\n } else {\n hideInputFields();\n }\n });"
},
{
"search": "// Event listeners\n $(\"#calculate-btn\").click(function() {\n let height = 0;\n if (selectedUnit === METRIC) {\n height = parseFloat($(\"#height-input-metric\").val());\n } else if (selectedUnit === IMPERIAL) {\n height = parseFloat($(\"#height-input-imperial\").val());\n }\n let weight = 0;\n if (selectedUnit === METRIC) {\n weight = parseFloat($(\"#weight-input-metric\").val());\n } else if (selectedUnit === IMPERIAL) {\n weight = parseFloat($(\"#weight-input-imperial\").val());\n }",
"replace": "// Event listeners\n $(\"#calculate-btn\").click(function() {\n let heightFeet = 0;\n let heightInches = 0;\n if (selectedUnit === METRIC) {\n height = parseFloat($(\"#height-input-metric\").val());\n } else if (selectedUnit === IMPERIAL) {\n heightFeet = parseFloat($(\"#height-input-feet\").val());\n heightInches = parseFloat($(\"#height-input-inches\").val());\n }\n let weight = 0;\n if (selectedUnit === METRIC) {\n weight = parseFloat($(\"#weight-input-metric\").val());\n } else if (selectedUnit === IMPERIAL) {\n weight = parseFloat($(\"#weight-input-imperial\").val());\n }"
},
{
"search": "// Constants\n const METRIC = \"metric\";\n const IMPERIAL = \"imperial\";",
"replace": "// Constants\n const METRIC = \"metric\";\n const IMPERIAL = \"imperial\";\n\n // Additional Constants\n const FEET_TO_CM = 30.48;\n const INCHES_TO_CM = 2.54;"
},
{
"search": "// User Input Selection: Unit of Measurement\n let selectedUnit = null;",
"replace": "// User Input Selection: Unit of Measurement\n let selectedUnit = null;\n\n // Additional Variables\n let heightFeet = 0;\n let heightInches = 0;"
},
{
"search": "// Functions\n function showInputFields(unit) {\n $(\"#height-input\").removeClass(\"d-none\");\n $(\"#weight-input\").removeClass(\"d-none\");\n\n if (unit === METRIC) {\n $(\"#height-input-label\").text(\"Height (cm)\");\n $(\"#weight-input-label\").text(\"Weight (kg)\");\n } else if (unit === IMPERIAL) {\n $(\"#height-input-label\").text(\"Height (ft/in)\");\n $(\"#weight-input-label\").text(\"Weight (lbs)\");\n }\n }",
"replace": "// Functions\n function showInputFields(unit) {\n $(\"#height-input\").removeClass(\"d-none\");\n $(\"#height-input-inches\").removeClass(\"d-none\");\n $(\"#weight-input\").removeClass(\"d-none\");\n\n if (unit === METRIC) {\n $(\"#height-input-label\").text(\"Height (cm)\");\n $(\"#weight-input-label\").text(\"Weight (kg)\");\n } else if (unit === IMPERIAL) {\n $(\"#height-input-label\").text(\"Height (ft)\");\n $(\"#height-input-inches-label\").removeClass(\"d-none\");\n $(\"#weight-input-label\").text(\"Weight (lbs)\");\n }\n }"
},
{
"search": "// Functions\n function validateInput(unit, height, weight) {\n let valid = true;\n let errorMessage = \"\";\n\n if (unit === METRIC) {\n if (height < 140 || height > 210) {\n valid = false;\n errorMessage += \"Height must be between 140 and 210 cm. \";\n }\n\n if (weight < 40 || weight > 200) {\n valid = false;\n errorMessage += \"Weight must be between 40 and 200 kg.\";\n }\n } else if (unit === IMPERIAL) {\n if (height < 55 || height > 83) {\n valid = false;\n errorMessage += \"Height must be between 4'7\\\" (55 inches) and 6'11\\\" (83 inches). \";\n }\n\n if (weight < 88 || weight > 440) {\n valid = false;\n errorMessage += \"Weight must be between 88 lbs and 440 lbs.\";\n }\n }\n\n return {\n valid: valid,\n errorMessage: errorMessage\n };\n }",
"replace": "// Functions\n function validateInput(unit, height, weight) {\n let valid = true;\n let errorMessage = \"\";\n\n if (unit === METRIC) {\n if (height < 140 || height > 210) {\n valid = false;\n errorMessage += \"Height must be between 140 and 210 cm. \";\n }\n\n if (weight < 40 || weight > 200) {\n valid = false;\n errorMessage += \"Weight must be between 40 and 200 kg.\";\n }\n } else if (unit === IMPERIAL) {\n if ((heightFeet < 4 || (heightFeet === 4 && heightInches < 7)) || heightFeet > 6 || (heightFeet === 6 && heightInches > 11)) {\n valid = false;\n errorMessage += \"Height must be between 4'7\\\" (55 inches) and 6'11\\\" (83 inches). \";\n }\n\n if (weight < 88 || weight > 440) {\n valid = false;\n errorMessage += \"Weight must be between 88 lbs and 440 lbs.\";\n }\n }\n\n return {\n valid: valid,\n errorMessage: errorMessage\n };\n }"
},
{
"search": "// Functions\n function calculateBMI(unit, height, weight) {\n let bmi = 0;\n\n if (unit === METRIC) {\n bmi = weight / Math.pow(height / 100, 2);\n } else if (unit === IMPERIAL) {\n bmi = (weight / Math.pow(height, 2)) * 703;\n }\n\n return bmi.toFixed(1);\n }",
"replace": "// Functions\n function calculateBMI(unit, height, weight) {\n let bmi = 0;\n\n if (unit === METRIC) {\n bmi = weight / Math.pow(height / 100, 2);\n } else if (unit === IMPERIAL) {\n let heightInches = (heightFeet * 12) + heightInches;\n let heightCm = heightInches * INCHES_TO_CM;\n bmi = (weight / Math.pow(heightCm / 100, 2)) * 703;\n }\n\n return bmi.toFixed(1);\n }"
},
{
"search": "// Event listeners\n $(\"#calculate-again-btn\").click(function() {\n resetInputs(); hideInputFields();",
"replace": "// Event listeners\n $(\"#calculate-again-btn\").click(function() {\n resetInputs();\n hideInputFields();\n $(\"#height-input-inches-label\").addClass(\"d-none\");"
},
{
"search": "<div id=\"height-input\" class=\"form-group d-none\">\n <label id=\"height-input-label\" for=\"height-input\" class=\"input-label\"></label>\n <input type=\"number\" id=\"height-input\" class=\"input-field\" step=\"0.01\">\n </div>",
"replace": "<div id=\"height-input\" class=\"form-group d-none\">\n <label id=\"height-input-label\" for=\"height-input\" class=\"input-label\"></label>\n <input type=\"number\" id=\"height-input-feet\" class=\"input-field\" step=\"0.01\">\n <input type=\"number\" id=\"height-input-inches\" class=\"input-field d-none\" step=\"0.01\">\n <label id=\"height-input-inches-label\" class=\"input-label d-none\">Height (in)</label>\n </div>"
}
]

NEW APPS

These are apps made by the community!

FAQ

What is Calculator Tools?

Calculator Tools allows you to instantly create and generate any simple one page web app for free and immediately have it online to use and share. This means anything! Mini apps, calculators, trackers, tools, games, puzzles, screensavers... anything you can think of that the AI can handle.

The AI uses Javacript, HTML, and CSS programming to code your app up in moments. This currently uses GPT-4 the latest and most powerful version of the OpenAI GPT language model.

What Do You Mean Make An App?

Have you ever just wanted a simple app but didn't want to learn programming or pay someone to make it for you? Calculator Tools is the solution! Just type in your prompt and the AI will generate a simple app for you in seconds. You can then customize it to your liking and share it with your friends.

AI has become so powerful it is that simple these days.

Does This Use ChatGPT?

It uses GPT-4 which is the most powerful model for ChatGPT.

Calculator Tools does not remember things from prompt to prompt, each image is a unique image that does not reference any of the images or prompts previously supplied.