William H. Hosterman, 84, an authority on hay and straw who worked for the Department of Agriculture from 1924 until his retirement in 1967, died at Goodwin House in Alexandria Sunday of congestive heart failure.

Mr. Hosterman was born on a farm in Centre County, Pa. He earned a bachelor's degree in agronomy at Penn State University in 1919 and a master's degree in farm crops from Michigan State University in 1923.

He moved to Washington the followingyear to begin his career at Agriculture as a junior marketing specialist for the hay, feed and seed division of the Bureau of Agriculture Economics. Over the years, his work concerned the development of standards for hay and straw and helping state agriculture extension services improving hay quality.

At the time of his retirement, Mr. Hosterman was assistant chief of the standardization and testing branch of the Grain Division in the Agriculture Marketing Service.

He lived in Washington and then in McLean. He had lived at Goodwin House since 1978.

A Mason for more than 60 years, Mr. Hosterman was a member of the Old Ford Lodge No. 537 in Pennsylvania and Potomac Chapter No. 8 of the Scottish Rite in Washington.

His wife, the former Beatrice R. Kreider, died in 1974. Survivors include a daughter, Elizabeth H. McKenna of McLean; a son, John W. Hosterman of Vienna, Va.; asister, Catherine Hosterman of Millheim, Pa.; two brothers, John David of Spring Mills Pa., and James, of Decatur, Ga.; eight grandchildren, and two great-grandchildren.

The family suggests that expressions of sympathy be in the form of contributions to the Goodwin House Fellowship Fund, Alexandria, or to a charity of one's choice.