Dunham was born in Wichita, Kansas, the younger of two sons to Ralph Waldo Emerson Dunham, Sr. and Ruth Lucille Armour. His father's ancestors settled in Kempton, Indiana, in the 1840s, before relocating to Kansas. His parents were married on October 3, 1915, at a home on South Saint Francis St. in Wichita, and opened The Travelers' Cafe on William Street situated between the old firehouse and the old Wichita City Hall. On November 25, 1926, at age 8, Dunham discovered his mother's body after she had committed suicide. Subsequently, Dunham's father placed him and his older brother Ralph Waldo Emerson Dunham, Jr. in the care of their maternal grandparents in El Dorado, Kansas. A rebellious teenager, Dunham allegedly punched his high school principal and spent some time drifting, hopping rail cars to Chicago, California, and back again. He married Madelyn Lee Payne on May 5, 1940, the night of her senior prom.
Dunham enlisted as a private in the U.S. Army on January 18, 1942, at Fort Leavenworth, Kansas, and served in the European Theatre of World War II with the 1830th Ordnance Supply and Maintenance Company, Aviation. During D-Day, this unit helped to support the 9th Air Force. Dunham and his brother were deployed to France six weeks after D-Day. Before the Invasion of Normandy, the brothers once met accidentally as Stanley Dunham went in search of rations at a hotel in London, where his brother Ralph Dunham happened to be staying. Madelyn Dunham gave birth to their daughter Stanley Ann Dunham, who was later known as Ann, at St. Francis Hospital in Wichita on November 29, 1942. During the war, Madelyn Dunham worked on a Boeing B-29 assembly line in Wichita.
Post-World War II
After two years of military service in Europe, Dunham was discharged from the U.S. Army on August 30, 1945. After the war, the family moved to Berkeley, California so he could pursue study at the University of California, Berkeley and then eventually back to El Dorado, Kansas, where Dunham managed a furniture store. In 1955, after the Dunhams moved to Seattle, Washington, Dunham worked as a salesman for the Standard-Grunbaum Furniture Company, and his daughter Ann attended middle school. The family lived in an apartment in the Wedgwood Estates in the Wedgwood, Seattle neighborhood. In 1956 they moved to the Shorewood Apartments on Mercer Island, a Seattle suburb. Ann attended high school there, and they stayed until she graduated in 1960. In 1957, Dunham started working for the Doces Majestic Furniture Company.
Hawaii
The family then moved to Honolulu, Hawaii, where Dunham found a better furniture store opportunity. Madelyn Dunham started working at the Bank of Hawaii in 1960, and was promoted as one of the bank's first female vice presidents in 1970. In Barack Obama's memoir, Dreams From My Father, he wrote, "One of my earliest memories is of sitting on my grandfather's shoulders as the astronauts from one of the Apollo missions arrived at Hickam Air Force Base after a successful splashdown". At 10 years old, Barack Obama moved in with the Dunhams in Honolulu to attend school in the U.S. while his mother and stepfather Lolo Soetoro were living in Jakarta, Indonesia. His mother later came back to Hawaii to pursue graduate studies, but when she returned to Indonesia in 1977 for her master's fieldwork, Obama stayed in the United States with his grandparents. Obama wrote in his memoir, Dreams From My Father, "I'd arrived at an unspoken pact with my grandparents: I could live with them and they'd leave me alone so long as I kept my trouble out of sight".