The recipe is just 18 small-type pages long--including four for additions and changes--and, if Grandma goes by the manual, out will come what the Pentagon considers the perfect Christmas fruitcake.

The nonclassified recipe, described as ''The Perfect Specification, Cost- Is-No-Object Fruitcake,'' was placed in the Congressional Record by Sen. Sam Nunn of Georgia, the ranking Democrat on the Senate Armed Services Committee. The proper nomenclature for the recipe, put on paper by the Army`s Research, Development and Engineering Command, is Military Specification MIL- F-1499F, amended 1980.

Private contractors were ordered to use the recipe to make 12 tons of fruitcakes this holiday season for U.S. troops overseas. And nothing is left to the cook`s imagination, including metric conversions.

For instance, Nunn noted the question of flavoring, in this case vanilla, which is item 3.2.7.

Now, 3.2.7 orders: ''Flavoring--Vanilla flavoring shall be pure or artificial vanilla in such quantities that its presence shall be

organoleptically detected but not to a pronounced degree.'' Fannie Farmer might have said enough vanilla to smell or taste, but not overpowering.

Or take 3.2.9, candied cherries: ''Candied cherries shall be made from pitted cherries. They shall be thoroughly processed with sugars to a soluble solids content of not less than 72 percent and artificially colored with a red dye. They shall be cut to yield 1/4- to 1/2-inch (6.4 to 12.88 mm.) cherry pieces on the average.''

Well, that was the way to handle the cherries until 1980. One of the changes dictated by the Defense Department, Nunn said, shifts ''the tolerance of candied cherries from 12.8 mm. to 12.7 mm. Always onward and upward.''

As for getting the fruitcake into the tin, 3.5.1 specifically states--and this is an order--that ''the finished product shall conform to the inside contour of the can or can liner.''

And fruits and nuts ''shall be evenly distributed,'' and lest they forget, commercial bakers are admonished, ''The flavor of the finished product shall be typical of the type indicated. There shall be no off-flavors or off- odors.''

Nunn, one of many critics of the Pentagon`s penchant for specifications, said, ''I am afraid this is typical of military specifications. It is not an exception.''

And he posed a question to ponder during that near-catatonic lull between Christmas dinner and desert: ''Can you imagine the specifications on an airplane or a complex weapons system?''