The following formulas will define horsepower as well as some of the physics relating to electricity. The conversion for a measurement in horsepower to electrical energy will be listed along with how it would be applied mainly to electric motors. Various electrical losses considered in actual application are also covered.
Origins of Horsepower

One of the earliest comparisons of a horse’s ability to a steam engine was in the year 1702 by Thomas Savery in his book “The Miner’s Friend.” It was shortly after that James Watt coined the term horsepower in order to market his improved steam engines. There seems to be some disagreement on how Mr. Watt determined the measurement of horsepower but this first method seems to be the most respected. Thomas determined that a horse could turn a mill wheel 2.4 times a minute. The wheel had a 12foot radius. Thomas also determined that the horse’s pull was equal to 180 pounds of force. So the equation became as follows:
Power = work / time = (force distance) / time = 180lbf (2.4 2? * 12ft) / 1 min
Electrical Power

Electrical power is the measurement of energy consumed in an electrical circuit. This type of power is expressed in watts or voltamperes. The unit of measurement is watts, which is voltage (or electrical pressure) times amps (the amount of electrons flowing past a given point in respect to time). See Ohm’s Law for power below: E I = P
E (electromotive force) = pressure in volts
I = electrical current in amps
P = power in watts
Watts 2 Horses

There is 745.7 watts of electrical energy in one horsepower of mechanical energy but this number is almost always rounded to 736 for calculations. The equation is as follows: 1HP = 746W
This formula deals strictly with the power converted into mechanical movement. It does not take into account heat and efficiency losses in the electric motor. Most of these losses are figured into an overall VA rating listed on the motor. The total VA as well as the horsepower output of the motor is listed on what is known as the “motor nameplate,” which is stamped on or riveted to most motors over ½ horsepower. Sometimes the motor’s efficiency is on the nameplate.
More Losses Not Coverd by the Conversion

It takes more than 746 watts of power for every horsepower of output to operate electric motor due to motor losses as well as wire losses. Generally, a motor is connected by wiring to a power source. In the real world, although a copper wire is a good conductor, it has some amount of resistance to electrical current flow. This is measured in ohms and is abbreviated by the symbol ?. The formula for ohms is: E / I = R (note also that IR = E).
R = resistance in omhs
Also we can now substitute Ohm’s Law for power this way:
2
P = (IR) I or P = I R
So in addiction to electrical power needed to overcome losses in the motor, operate the motor at a certain horsepower, we also need electrical power to overcome wire losses to get power to the motor.
How Many Horses R in That Motor?

This calculation will rely on mechanical information to get the horsepower rating then converting back to watts will be easy: HP = 2?(rpm)LP / 33000
Rpm = rotations per minute L = distance in feet P = pounds 33000 = the constant for horsepower. L and P can be replaced by foot pounds of torque if this value is known.
Once the horsepower is calculated, multiply by 746 to get watts. To find the motor's actual efficiency requires amperage and voltage measurements at the load with a true rms meter or true rms wattmeter. With the true wattage converted to horsepower use the total wattage measured by the meter: Power out / Power in (100) = % of efficiency of the motor.
Final Thoughts and Safety

Before designing any installation of an electric motor or motor branch circuit, look into your local building codes. Realize that things like conductor sizes must be calculated based on the intended load and environmental temperatures. Also before rating the size horsepower motor for an application, know that high ambient temperatures will require you to lower a motor’s horsepower rating. This is referred to as derating in the National Electrical Code. The best references for these type calculations and wiring methods would be to look them up in the National Fire Protection Agency article 70. Most important, do not work on live circuits.
References
 Delmar's Standard Textbook of Electricity: Second Edition