Stanley S. Carpenter, 64, a retired Foreign Service Officer and former deputy assistant secretary of the Interior, died Saturday in Arlington Hospital after a heart attack. He was a resident of Arlington.

Dr. Carpenter joined the Foreign Service in 1947 as a consular officer in Kobe, Japan. He later served as political officer and Japanese language officer in Tokyo. His other foreign assignments with the State Department took him to the U.S. Embassy in London and to Copenhagen, Denmark, where he was counselor and consul general from 1962 to 1965.

In the late 1960s he worked for the Army Department as civil administrator for the Ryukyu Islands, before they were returned to Japan. He began a three-year stint as assistant secretary of the Interior for Territorial Affairs in January 1972, and retired from the Foreign Service in 1977.

Dr. Carpenter was the recipient of the State Department's Superior Honor Award, the Interior Department's Superior Service Award, and the Army Department's Distinguished Civilian Service Award. He was a member of DACOR (Diplomatic and Consular Officers Retired).

In recent years he had been a consultant to the State Department on questions ranging from personnel policy to the actions of the department as they related to the Jonestown massacre in Guyana.

Dr. Carpenter was a native of Boston. He was a 1940 graduate of Wheaton College in Illinois, and earned his master's and doctoral degrees in classics at the University of Illinois. He was a member of Phi Beta Kappa.

He served as an Army officer from 1943 to 1947, part of that time on the staff of Gen. Douglas MacArthur's occupation forces in Japan.

Dr. Carpenter's survivors include his wife of 40 years, the former Alice Luken, of Arlington; a son, Wendell, of Research Triangle Park, N.C., a daughter Terry Ann, of Chicago, Ill., and three sisters, Mrs. Robert Thompson, and Eleanor and Marjorie Carpenter, all of Pittsfield, Mass.

The family suggest that expressions of sympathy be in the form of contributions to the DACOR Scholarship Fund in Washington.