In 1901, 20-year-old William S. Harley drew up plans for a small engine with a displacement of 7.07 cubic inches (116 cc³) and four-inch (102 mm) flywheels. The engine was designed for use in a regular pedal-bicycle frame. Over the next two years, Harley and his childhood friend Arthur Davidson worked on their motor-bicycle using the northside Milwaukee machine shop at the home of their friend, Henry Melk. It was finished in 1903 with the help of Arthur's brother, Walter Davidson. Upon testing their power-cycle, Harley and the Davidson brothers found it unable to climb the hills around Milwaukee without pedal assistance. They quickly wrote off their first motor-bicycle as a valuable learning experiment.
Work immediately began on a new and improved second-generation machine. This first "real" Harley-Davidson motorcycle had a bigger engine of 24.74 cubic inches (405 cc³) with 9.75 inches (25 cm) flywheels weighing 28 lb (13 kg). The machine's advanced loop-frame pattern was similar to the 1903 Milwaukee Merkel motorcycle (designed by Joseph Merkel, later of Flying Merkel fame). The bigger engine and loop-frame design took it out of the motorized bicycle category and marked the path to future motorcycle designs. The boys also received help with their bigger engine from outboard motor pioneer Ole Evinrude, who was then building gas engines of his own design for automotive use on Milwaukee's Lake Street.
The prototype of the new loop-frame Harley-Davidson was assembled in a 10 ft × 15 ft (3.0 m × 4.6 m) shed in the Davidson family backyard. Most of the major parts, however, were made elsewhere, including some probably fabricated at the West Milwaukee railshops where oldest brother William A. Davidson was then toolroom foreman. This prototype machine was functional by September 8, 1904, when it competed in a Milwaukee motorcycle race held at State Fair Park. It was ridden by Edward Hildebrand and placed fourth. This is the first documented appearance of a Harley-Davidson motorcycle in the historical record.
In January 1905, small advertisements were placed in the Automobile and Cycle Trade Journal offering bare Harley-Davidson engines to the do-it-yourself trade. By April, complete motorcycles were in production on a very limited basis. That year, the first Harley-Davidson dealer, Carl H. Lang of Chicago, sold three bikes from the five built in the Davidson backyard shed. Years later the original shed was taken to the Juneau Avenue factory where it would stand for many decades as a tribute to the Motor Company's humble origins until it was accidentally destroyed by contractors cleaning the factory yard in the early 1970s.
In 1906, Harley and the Davidson brothers built their first factory on Chestnut Street (later Juneau Avenue), at the current location of Harley-Davidson's corporate headquarters. The first Juneau Avenue plant was a 40 ft × 60 ft (12 m × 18 m) single-story wooden structure. The company produced about 50 motorcycles that year.
In 1907, William S. Harley graduated from the University of Wisconsin–Madison with a degree in mechanical engineering. That year additional factory expansion came with a second floor and later with facings and additions of Milwaukee pale yellow ("cream") brick. With the new facilities production increased to 150 motorcycles in 1907. The company was officially incorporated that September. They also began selling their motorcycles to police departments around this time, a market that has been important to them ever since.
In 1907 William A. Davidson, brother to Arthur and Walter Davidson, quit his job as tool foreman for the Milwaukee Road railroad and joined the Motor Company.
Production in 1905 and 1906 were all single-cylinder models with 26.84 cubic inch (440 cm³) engines. In February 1907 a prototype model with a 45-degree V-Twin engine was displayed at the Chicago Automobile Show. Although shown and advertised, very few V-Twin models were built between 1907 and 1910. These first V-Twins displaced 53.68 cubic inches (880 cm³) and produced about 7 horsepower (5.2 kW). This gave about double the power of the first singles. Top speed was about 60 mph (100 km/h). Production jumped from 450 motorcycles in 1908 to 1,149 machines in 1909.
Harley-Davidson launched a line of bicycles in 1917 in hopes of recruiting customers for its motorcycles. Besides the traditional diamond frame men's bicycle, models included a step-through frame 3-18 "Ladies Standard" and a 5-17 "Boy Scout" for youth. The effort was discontinued in 1923 because of disappointing sales.
The bicycles were built for Harley-Davidson in Dayton, Ohio, by the Davis Machine Company from 1917 to 1921, when Davis stopped manufacturing bicycles.