Kilowatts to Amps Calculator Using JavaScript With HTML

Hello Friends Today, through this tutorial, I will tell you How to Program Kilowatts to Amps calculator using JavaScript with HTML? Example of a Kilowatts to Amps calculator created using JavaScript with HTML:


<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kilowatts to Amps Calculator</title>
body {
font-family: Arial, sans-serif;
margin: 20px;
label {
display: block;
margin-bottom: 8px;
input {
width: 100%;
padding: 8px;
margin-bottom: 16px;
box-sizing: border-box;
button {
background-color: #4CAF50;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
button:hover {
background-color: #45a049;
<h2>Kilowatts to Amps Calculator</h2>
<label for="kilowatts">Enter Power (kW):</label>
<input type="number" id="kilowatts" placeholder="Enter power in kW">
<button onclick="calculateAmps()">Calculate Amps</button>

<p id="result"></p>

function calculateAmps() {

// Get the power input value in kilowatts
const powerKW = parseFloat(document.getElementById('kilowatts').value);

// Standard voltage (adjust as needed)
const voltage = 120;

// Calculate amperage
const amps = (powerKW * 1000) / voltage;

// Display the result
document.getElementById('result').innerHTML = `Amperage: ${amps.toFixed(3)} A`;


This HTML file includes an input field for entering power in kilowatts, a button to trigger the calculation, and a result paragraph to display the calculated amperage. Adjust the voltage variable based on your specific application. When the button is clicked, the `calculateAmps` function is called, which performs the calculation and updates the result on the page.