WASHINGTON (AP) _ Spending on social welfare programs - from public schools to Social Security and Medicare - rose to $672 billion in fiscal 1984 but claimed a smaller share of the gross national product, federal figures show.

The total spent increased nearly $30 billion, or 4.7 percent, from fiscal 1983 to fiscal 1984, the most recent year for which figures are available. But after taking inflation into account, the increase in real dollars was $3.3 billion, or 0.5 percent, a federal researcher reported Tuesday.

That is ''the lowest real year-to-year increase since 1978-79, when real expenditures dropped 0.1 percent,'' reported Ann Kallman Bixby of the Social Security Administration's Office of Research and Statistics.

The $672 billion includes all the money spent by every level of government - federal, state and local - on the whole panopoly of social programs, Social Security, Medicare, Medicaid, welfare, veterans' programs, education, housing, pensions and others.

Social welfare expenditures' share of the GNP fell from 19.3 percent in 1983 to 18.2 percent in 1984. That was because while social spending was growing by 0.5 percent, real GNP grew nearly 7 percent in the same period, Bixby wrote in a brief statistical report.

In 1976, social welfare spending accounted for 60 cents of every dollar spent by government programs. In 1984, the social welfare programs spent less than 53 cents from every government dollar.

The figures, compiled annually by Bixby's office, show that state and local governments spent a larger share of their funds on social welfare than did the federal government: 59 percent versus 50 percent.

But Washington provided most of the dollars: $419.3 billion compared with $252.7 billion spent by state and local governments. That is a 62 percent to 38 percent split.

Social welfare spending still accounted for a majority share of the federal budget, but it contracted during the first three years of the Reagan administration. Social welfare programs claimed 53.9 percent of the federal budget in 1981 and 50.2 percent in 1984.

During the same period, social welfare expenditures by states and localities dropped from 62 percent to 59 percent of their budgets.

Here is a categorical breakdown of how the $672 billion was spent:

-$342.3 billion for social insurance, including Social Security, Medicare and government pensions.

-$152 billion for education.

-$89.9 billion for public aid, including Medicaid, food stamps, Aid to Families with Dependent Children and Supplemental Security Income.

-$37.9 billion for other health and medical care.

-$26.1 billion for veterans' programs.

-$10.4 billion for housing.

-$13.4 billion for assorted other services, including vocational rehabilitation, institutional care and child nutrition.

By comparison, Pentagon spending accounted for 25.9 percent of the federal budget in 1984 and 6 percent of GNP. Currently, the Defense Department budget accounts for 27 percent of all federal expenditures and 6.2 percent of GNP.