The nation's number one naval officer yesterday broke with President Carter and became the first member of the Joint Chiefs of Staff to come out for a return to the draft.

Adm. Thomas B. Hayward, chief of naval operations, said he has changed his mind about the staying power of the all-volunteer force that replaced the draft after the Vietnam war.

"The all-volunteer force is gradually slipping into a failure mode," Hayward said at at breakfast meeting with reporters.

"It's the recession that's making it look a little better than it probably is below the surface," said Hayward of the AVF, as young people sign up with the military services for want of jobs on the civilian market.

But as soon as the economy improves, Hayward predicted, the armed services will run short of people to fill their ranks, as they did last year. He doubted military pay raises and educational benefits now before Congress would be enough to save the AVF.

More important than filling the ranks, said Hayward, is the national commitment to defense that a return to conscription would represent.

"The time has come for the country to get mobilized in its attitude about national security. A commitment through national military service would not disappoint me. Philosophically, I'm in favor of the draft. That's change from a year and a half ago."

Carter, in pressing Congress this year to require 19 and 20 year olds to register, insisted that he had no intention of drafting anybody in peacetime. He said the AVF is working satisfactorily.

Pentagon spokesman Thomas B. Ross said yesterday that this is still the administration's position.

Hayward's remarks will be welcomed by such members of Congress as Chairman John Stennis (D-Miss.) of the Senate Armed Services Committee and Rep. G. V. (Sonny) Montgomery (D-Miss.), a member of the House Armed Services Committee, who have been pressing for the draft.

Although Hayward is the first chief of a service publicly to endorse conscription, others have been leaning that way. Commandant Robert H. Barrow of the Marine Corps has said the military is running low on quality volunteers while Gen. E. C. Meyer, Army chief of staff, has said conscription would have mixed results, solving some problems and causing others.

Gen. Lew Allen Jr., chief of staff of the Air Force which is the service experiencing the fewest recruiting problems, has, along with the other chiefs, endorsed requiring young people to register for the draft but not conscription itself.

Hayward, in acknowledging yesterday that his remarks had taken him out front on the draft issue, said, "I'm not going to be out beating the drum for the draft."

Instead, he said he was sharing a conclusion reached in weighing the AVF against conscription. Since the AVF came into being in 1973, said Hayward, "the average family in the United States has simply said, 'We won't worry about that. We'll let somebody else worry about that.'

"I think the day has come when that philosophy is wrong," continued the nation's top naval officer. "Military service has never hurt anybody that I'm aware of. I think it would be a good thing for our young people to serve.

"We've got to recognize that as a leader of the free world we've got to have the country unified and a strong commitment to national defense. I think conscription would help that, not hurt it."

Hayward's endorsement of the draft is sure to fuel organized efforts to persuade young people to refuse to register for the draft. Under legislation passed by the House and Senate, men, but not women, born in 1960 and 1961 would have to fill out draft registration forms at local post offices this year. Failure to do so risks being fined up to $10,000 and going to jail for five years.

As for taking the next step to conscription, Hayward said, "I'm absolutely confident that there would be a lot of youth organizations that would protest. But would they in fact represent the national consensus? I don't think they would."

Asked if he favored a selective draft to bring more highly educated people into the military, Hayward said he had not thought through the details, adding:

"It's got to be 100 percent fair and square. We sure could make it a lot fairer than it used to be, by light years."

Reminded that Army Secretary Clifford L. Alexander has repeatedly argued that the military would not get any higher quality people through the draft than it is through volunteers, Hayward said that is "a subjective call. I think all services would come up some."

Last November Hayward said he opposed returning to the draft because "I can see all the dissidents coming out of the woodwork and going through all that trauma" of the Vietnam era. "I don't want that."