William MacRae (September 9, 1834 – February 11, 1882) was a Confederate general who served during the American Civil War.
At the Battle of Antietam, MacRae commanded the brigade which had been reduced to 250 men during the fighting over the previous few weeks.
MacRae's brigade repulsed three Union assaults but fell back when he had only 50 effectives remaining and his supply of ammunition was exhausted.
At the Ream's Station MacRae's, Lane's, and Cooke's brigades drove John Gibbon's 2nd Division of Winfield Scott Hancock's II Corps from its entrenchments in their front and captured an artillery battery.
After meritorious service at the Battle of Boydton Plank Road MacRae remained with the army through the Appomattox Campaign.