Make a Three-Phase Power Calculator in JavaScript (Step-by-Step Project)

Build a Three-Phase Power Calculator using JavaScript with real electrical formulas, current calculation, responsive UI, and FAQs.

Three-phase electrical systems are widely used in industries, factories, commercial buildings, solar systems, and data centers. Electrical engineers frequently need to calculate current, power, voltage, and power factor for motors, transformers, and industrial loads.

In this tutorial, you will learn how to build a professional Three-Phase Power Calculator using:

  • HTML
  • CSS
  • JavaScript

This project is beginner-friendly and works directly in the browser without any external library. 

 Figure-1: Three-Phase Power Calculator Preview


Features of This Project

  • Calculate three-phase current instantly
  • Supports power factor input
  • Professional responsive design
  • Real engineering calculation formula
  • Pure JavaScript project
  • Mobile-friendly UI

Understanding the Three-Phase Power Formula

The standard three-phase power equation is:

P = √3 × V × I × cosφ

Symbol Meaning
P Power (Watts)
V Line Voltage
I Line Current
cosφ Power Factor

To calculate current:

I = P / (√3 × V × cosφ)

Figure-2: Three-Phase Power Formula Diagram 


Project Structure

index.html
style.css
script.js

Step 1 — Create the HTML File

index.html

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Three-Phase Power Calculator</title>

    <link rel="stylesheet" href="style.css">
</head>

<body>

<div class="container">

    <h1>Three-Phase Power Calculator</h1>

    <div class="input-group">
        <label>Power (kW)</label>
        <input type="number" id="power" placeholder="Enter Power">
    </div>

    <div class="input-group">
        <label>Voltage (V)</label>
        <input type="number" id="voltage" placeholder="Enter Voltage">
    </div>

    <div class="input-group">
        <label>Power Factor</label>
        <input type="number" id="pf" step="0.01" placeholder="Enter PF">
    </div>

    <button onclick="calculateCurrent()">
        Calculate Current
    </button>

    <div class="result">
        <h2 id="output">Current: 0 A</h2>
    </div>

</div>

<script src="script.js"></script>

</body>
</html>

Step 2 — Add CSS Styling

style.css

body{
    font-family: Arial, sans-serif;
    background:#f4f4f4;
    display:flex;
    justify-content:center;
    align-items:center;
    height:100vh;
}

.container{
    background:white;
    padding:30px;
    width:350px;
    border-radius:10px;
    box-shadow:0 0 10px rgba(0,0,0,0.2);
}

h1{
    text-align:center;
    margin-bottom:20px;
}

.input-group{
    margin-bottom:15px;
}

label{
    display:block;
    margin-bottom:5px;
    font-weight:bold;
}

input{
    width:100%;
    padding:10px;
    border:1px solid #ccc;
    border-radius:5px;
}

button{
    width:100%;
    padding:12px;
    background:#007bff;
    color:white;
    border:none;
    border-radius:5px;
    cursor:pointer;
    font-size:16px;
}

button:hover{
    background:#0056b3;
}

.result{
    margin-top:20px;
    text-align:center;
}

Step 3 — Add JavaScript Logic

Figure-3: JavaScript Calculation Logic

script.js

function calculateCurrent(){

    let power = document.getElementById("power").value;
    let voltage = document.getElementById("voltage").value;
    let pf = document.getElementById("pf").value;

    // Convert kW to Watts
    power = power * 1000;

    // Three-phase current calculation
    let current = power / (1.732 * voltage * pf);

    // Display result
    document.getElementById("output").innerHTML =
        "Current: " + current.toFixed(2) + " A";
}

How the JavaScript Works

Getting Input Values

document.getElementById("power").value

This reads the value entered by the user.

Converting kW to Watts

power = power * 1000;

The formula uses Watts, so kW must be converted.

Current Formula

current = power / (1.732 * voltage * pf);

Here:

  • 1.732 = √3
  • Voltage = line voltage
  • PF = power factor

Example Calculation

Suppose:

  • Power = 15 kW
  • Voltage = 415 V
  • Power Factor = 0.85

Then:

I = 15000 / (1.732 × 415 × 0.85)

Current ≈ 24.55 A

Figure-4: Example Current Calculation 


Applications of This Calculator

  • Industrial motor load calculation
  • Transformer sizing
  • Generator sizing
  • Solar inverter current calculation
  • Electrical panel design
  • Cable size estimation

 Figure - 5: Industrial Applications of Three-Phase Systems 


Common Beginner Mistakes

1. Forgetting kW to Watt Conversion

Wrong:

current = power / (1.732 * voltage * pf);

Correct:

power = power * 1000;

2. Using Incorrect Voltage

For three-phase systems, use line voltage such as:

  • 400V
  • 415V
  • 440V

Advanced Features You Can Add

  • kVA Calculator
  • Power Factor Correction
  • Voltage Drop Calculator
  • Cable Size Recommendation
  • Dark Mode
  • PDF Report Export
  • Real-time Graph

SEO Keywords

  • Three phase calculator JavaScript
  • Electrical engineering JavaScript project
  • Three phase current calculator
  • Power calculator project
  • Industrial power calculator
  • JavaScript engineering tools

FAQs

What is a three-phase power system?

A three-phase power system is an AC electrical system using three alternating currents with phase differences of 120 degrees. It is commonly used in industries and commercial applications.

Why is √3 used in the formula?

The value √3 (1.732) comes from the mathematical relationship between line voltage and phase voltage in a three-phase system.

Can this calculator work for motors?

Yes. This calculator can estimate motor current based on power, voltage, and power factor.

What is power factor?

Power factor represents the efficiency of electrical power usage. It is the ratio of real power to apparent power.

Can I use this project for my portfolio?

Yes. This is an excellent beginner electrical engineering + JavaScript portfolio project.

What programming language is used in this project?

This project uses:

  • HTML
  • CSS
  • JavaScript

Can I add more electrical calculations?

Yes. You can add:

  • kVA calculations
  • Voltage drop calculations
  • Cable sizing
  • Transformer efficiency
  • Power factor correction

Conclusion

You have successfully built a complete Three-Phase Power Calculator using JavaScript. This project combines electrical engineering concepts with web development and is an excellent real-world engineering tool.

You can further improve the calculator by adding advanced electrical calculations, responsive UI components, and industrial engineering features.

About the author

Prasun Barua
Prasun Barua is a graduate engineer in Electrical and Electronic Engineering with a passion for simplifying complex technical concepts for learners and professionals alike. He has authored numerous highly regarded books covering a wide range of elec…

Post a Comment