The Carter administration has decided to help Egypt revitalize its arms industry, including the manufacture of big guns, tank weaponry and aircraft engines, defense officials said yesterday.

Pentagon research director William J. Perry, who is directing the administration effort, recently returned from Cairo, where he discussed the master plan for beefing up Egypt's defense production.

The administration's rationale for helping Israel's former enemy rearm is that Egyptian President Anwar Sadat cannot survive politically if his military machine rusts away.

Saudi Arabia, as part of its effort to isolate Sadat from the rest of the Arab world, has stopped bankrolling Egypt's arms industry. A Pentagon team recently inspected Egypt's factories, built largely with Saudi money, and came away highly impressed with their potential.

Britain and France, according to administration officials, are reluctant to help Sadat modernize those defense plants, for fear of offending a more lucrative customer, Saudi Arabia.

And, according to administration officials, President Carter does not want to force Sadat to turn back to the Soviets in desperation to get help for his war machine, including its industrial base.

"As we see it," an administration executive said yesterday, "we have no choice" but to help Sadat rebuilt and improve his arms industry. Sadat's departure, it is argued, almost certainly would sink the peace treaty between Egypt and Israel - Carter's centerpiece of foreign policy achievements.

The master plan for modernizing Egypt's defense industry now is being drafted in Washington and Cairo, with defense specialists from both capitals crisscrossing the Atlantic for frequent consultation.

According to Pentagon officials, the plan will not be in final form until fall, but already there is U.S.-Egyptian agreement on the key points.

The emphasis will be on projects that can show quick results, rather than on some sophisticated weapon that Sadat could not soon display.

Egypt already has a factory and the skilled manpower for manufacturing artillery, for example, including the versatile 155-millimeter howitzer, Pentagon officials said. American technical help here would show quick results.

To the astonishment of some administration visitors, Egypt also has a highly skilled metal fabrication plant and other factories that can produce jet aircraft engines and diesel engines for tanks and trucks.

In addition to striving for immediate and visible improvement, the Pentagon will suggest how Egypt's existing industry could be modernized to produce the most bang for the buck in weapons especially needed for Mid-east warfare.

It is in that context, administration officials said, that the United States will help Egypt upgrade Russian tanks supplied when the Soviet Union was Cairo's military supplier and mentor. The Institute for Strategic Studies estimates that Egypt has 1,680 Soviet tanks, including 750 of the lethal T62. However, many of the Soviet tanks are broken down.

Egyptian and American technicians plan to get the tanks rolling again and give them more punch. New diesel engines, guns and night vision devices are seen as part of t,is upgrading effort.

As a Mideast irony, some of the knowledge of how to improve the Soviet tanks came to Americans from the Israelis and now will be passed on to the Egyptians.

Egypt also has hundreds of Soviet planes, but they are not flying for want of spare parts and other mechanical problems, and they need better weaponry.

The Carter administration decided, before the Mideast peace treaty was signed, to allow U.S. firms to repair Sadat's Soviet warplanes, Sophisticated aircraft plants, like those here, can make parts for another nation's planes.

Egypt also will develop more capability to do its own repairs on Soviet weapons.

"The big-ticket facilities are already built, said an administration official, pointing to defense factories in place in Egypt, and so vital plant improvements can be made for relatively little money.

Pentagon planning calls for improving Egypt's defense production base without having to ask Congress for any more money than the $1.5 billion already authorized for fiscal 1979 through 1981.

Sadat has directed his assistant defense minister, Gen. Gamal El Sayed, to take personal charge of drafting and implementing this improvement plan for Egypt's ailing defense industry, sources said. The effort is taking off with few problems, according to defense officials.

Israel is fully aware of the U.S. effort, which, if successful, would make Egypt more of a military threat. Administration officials contend Israel will remain the superior military power.

In addition, administration officials believe that Egyptian and Israeli leaders mean it when they say their countries will not war with each other again.

Until Sadat made peace with Israel, much of the rest of the Arab world saw Egypt as its arsenal for weapons and its talent pool for managerial and technical skills. The peace treaty changed all that, creating a gap the United States is trying to fill.