The Reagan administration has decided to allow Algeria to purchase arms from the United States for the first time since that North African country's independence 23 years ago, State Department and Algerian diplomatic sources said yesterday.

The decision, consisting of a presidential determination declaring Algeria eligible, was made April 10, apparently in preparation for a four-day state visit by Algerian President Chadli Bendjedid that begins today.

A State Department spokesman, confirming the report, said any Algerian arms request would be considered by the administration "on a case-by-case basis" and in a manner "consistent with the U.S. interest in peace and regional stability."

This apparently was an allusion to the longstanding rivalry in North Africa between Algeria and Morocco, a close U.S. political and military ally. This rivalry has been complicated by Morocco's fight against an Algerian-supported independence movement by guerrillas in the western Sahara just to the south.

Algerian Ambassador Mohamed Sahnoun, who was informed of the U.S. decision by the State Department yesterday, said Algeria was interested in purchasing U.S. weapons to reduce his country's dependence on its longtime main arms supplier, the Soviet Union.

Sahnoun said President Bendjedid was not coming to Washington with a shopping list, but he indicated that Algeria was generally interested in American military aircraft, electronic equipment and radar.

"We don't have a specific list of items we want to acquire right away," he said in an interview with The Washington Post.

The United States earlier sold Algeria some C130 transport planes and has just approved a $50,000 International Military Education and Training Program for Algerian officers this fiscal year.

This is the first time, however, that it has declared the country eligible to obtain general defense equipment under the Foreign Military Sales Program, which provides foreign governments with credit and concessional interest rates, if needed, to help finance the purchases..

Algeria purchased 17 C130s several years ago on a commercial basis that does not require a presidential ruling on whether it is considered a "friendly" country eligible for the Foreign Military Sales Program. It was not immediately clear whether the Algerians would in fact seek credits and concessional terms for any future purchases.

Bendjedid's state visit here, the first by an Algerian leader, is the most visible illustration of that country's shift under his six-year-old leadership toward closer relations with the West in general and United States in particular.

After nearly two decades of correct but hardly warm ties, Algeria and the United States began developing a closer relationship during the 1979-81 crisis over U.S. hostages seized by the Iranian government. The Algiers government played a central role in negotiating the release of the Americans held in the U.S. Embassy in Tehran.

The special Algerian role during that crisis created a new appreciation in Washington for that country. Previously, its close identification with Moscow, mainly because of massive arms purchases, and its militant nonalignment had kept any closer relationship from developing outside the economic field.