Ohm's Law Calculator
Calculate Voltage (V), Current (I) or Resistance (R) instantly using Ohm's Law. Enter any two values and the calculator automatically computes the third.
Calculator
How to Use
- Enter any two values.
- Leave the unknown field empty.
- Click Calculate.
- The missing value is calculated automatically.
Ohm's Law Formula
| Unknown | Formula |
|---|---|
| Current | I = V ÷ R |
| Voltage | V = I × R |
| Resistance | R = V ÷ I |
Example
Voltage = 24 V
Resistance = 8 Ω
Current:
24 ÷ 8 = 3 A
JavaScript
function calculateOhmsLaw(){
let V=parseFloat(document.getElementById('voltage').value);
let I=parseFloat(document.getElementById('current').value);
let R=parseFloat(document.getElementById('resistance').value);
let filled=0;
if(!isNaN(V)) filled++;
if(!isNaN(I)) filled++;
if(!isNaN(R)) filled++;
if(filled!=2){
document.getElementById('result').innerHTML=
'Please enter exactly two values.';
return;
}
let html='';
if(isNaN(V)){
V=I*R;
html='Voltage
'+V.toFixed(3)+' V
';
}else if(isNaN(I)){
I=V/R;
html='Current
'+I.toFixed(3)+' A
';
}else{
R=V/I;
html='Resistance
'+R.toFixed(3)+' Ω
';
}
document.getElementById('result').innerHTML=html;
}
function clearResult(){
document.getElementById('result').innerHTML='';
}
Features
- Calculate Voltage.
- Calculate Current.
- Calculate Resistance.
- Instant calculation.
- Works on desktop and mobile.
- No page reload.