Leroy R. Grumman, 87, a founder of the giant aerospace firm that bears his name and an innovative engineer who designed and built carrier-based airplanes widely used by the Navy in World War II, died yesterday at a hospital in Manhasset, N.Y., after a long illness.

At his plants on Long Island, Mr. Grumman turned out thousands of Wildcat and Hellcat fighter planes and Avenger torpedo bombers that played vital roles in the Navy's Pacific campaigns.

In the 17 years from 1929, when the Grumman Corp. was founded as a repair shop for amphibious aircraft, to 1946, when he retired as its president, Mr. Grumman saw and supervised a rapid progression from stubby propeller-driven biplanes to sleek and swift jets.

Founded by Mr. Grumman and four others with 16 employes, the company grew by the end of World War II to employ 20,000. When in 1966, 20 years after leaving the presidency, Mr. Grumman stepped down as chairman of the board, his company was building the lunar module that carried the Apollo astronauts to the moon.

Perfection of the folding wings that became commonplace on the Navy's carrier-based planes by the end of World War II, making possible the storage of as many as 50 percent more aircraft aboard ship, was credited to Mr. Grumman.

In addition, the adoption by the Navy of retractable landing gear in the early 1930s for its carrier-based planes has been traced to a design by Mr. Grumman. His 1931 design demonstrated that the retractable gear would provide more in performance than it cost in weight and complexity of construction.

A college-trained engineer and a Navy-trained pilot, Mr. Grumman, who was called Roy by his friends, was described as a reticent, reflective man, who was informal in his approach to management and was given to working in shirtsleeves and to propping his feet on his office desk.

It was said that he worked out the mechanism of the folding airplane wing by manipulating paper clips stuck into an eraser.

He credited his own flying with honing his design and engineering skills.

"When you're alone five thousand feet in the air," he said many years ago, "lots of things about a plane become important that you can overlook on the ground."

Leroy Randle Grumman, who led his company into the space age, was born Jan. 5, 1895, in Huntington, Long Island, the son of a carriage shop owner. After studying engineering at Cornell, he went to work as a New York Telephone Co. engineer and joined the Navy in 1917 when the nation entered World War I.

A test pilot when he left the Navy in 1920, he became general manager and aeronautical engineer with one of the early airplane companies. In 1929, when it was about to merge with another firm, Mr. Grumman started his own business, supplying $17,000 of the $32,000 capital of the Grumman Aircraft Engineering Corp. as the firm was then known.

In addition to developing carrier-based warplanes in the 1930s, Mr. Grumman also produced twin-engine amphibians for private use that were still flown for years afterward.

The Wildcat fighter was in use at the start of World War II, and was flown at Midway and Guadalcanal. Its successor, the Hellcat, was designed after war broke out, and with more than 10,000 built by war's end, its production set records.

Mr. Grumman's numerous awards included the Presidential Medal for Merit and the Guggenheim Medal for pioneering in aeronautics.

Survivors include his wife, Rose, three daughters and a son.