Horsepower (HP) is a measurement of power developed by Scottish engineer James Watt in the 18th century to compare the output of steam engines and a horse.
There are two common definitions of the value of 1 horsepower, mechanical which is 745.7 watts, and metric which is 735.5 watts.
Power in watts is calculated by multiplying force in newtons by the distance in meters divided by time in seconds.
watts = force * distance / time
To get the watts in horsepower divide it by 745.7 for mechanical or 735.5 for metric:
HP = watts / 745.7
While this formula is simple enough to calculate, I made this horsepower calculator to make it easier to get horsepower in various representations based on different known force units.