In 1763, Richard Brooke received a patent for a tract of land located in the Province of Maryland. Originally known as Mechanicsville, the village which became Olney was established in 1800. The area was mostly farmland, but it soon began attracting artisans. Early residents Sarah Brooke and Dr. Charles Farquhar were devotees of the English poet William Cowper, and named their home after the poet's hometown of Olney in England. The area was later named for their home, which still stands and is known as the Olney House. In the town's center was a blacksmith, William Kelley's wheelwright shop, Canby's pottery factory, and a Benedict Duley's store.
The Brooke family held the largest tracts of land in Olney, whose central village was at the intersection of the Rockville to Baltimore road, and the one which connected Washington with Westminster, Maryland, to the north. The Quaker community in Sandy Spring thrived just to Olney's east. The Sandy Spring Museum is a historical museum featuring educational programs and displays. St. John's Episcopal Church was established in 1842 and survives to this day.
After the siege of Washington by the British in 1814 during the War of 1812, President Madison and his family passed through Olney en route to taking refuge in the neighboring town of Brookeville. Although not as involved in the Civil War as areas of Maryland to the west, Olney residents still experienced the tug-of-war between loyalty to the plantation economy of the South and to the Federal government in Maryland's midst. Both Union and Confederate forces made stops in Olney during the war. Union Generals George B. McClellan and Ambrose Burnside led soldiers through in the midst of the Maryland Campaign in 1862. During the Gettysburg Campaign in 1863, Confederate General J. E. B. Stuart marched between 10,000 to 20,000 troops north through the village and raided it of supplies, including horses and crops from surrounding farms in which they bivouacked.
Olney served as the original headquarters of the Emergency Management Institute, founded in 1951 as the Civil Defense Staff College (CDSC) to provide training for civil defense. While there, the college built "Rescue Street," a training center designed to resemble atomic bomb ruins. The CDSC was soon relocated to Battle Creek, Michigan due to security concerns of a potential attack on Washington, D.C. during the Cold War.
As an unincorporated area, Olney's boundaries are not officially defined. The United States Census Bureau defines a census-designated place of Olney centered at 39°9' North and 77°5' West. It has a total area of 13.0 square miles (34 km2), all land.