House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) said yesterday that he would "definitely, absolutely" run again in 1984.

The decision ends months of speculation on Capitol Hill over whether the 71-year-old veteran would retire at the end of his current term, his 16th.

Since the 98th Congress opened in January, many Democrats have urged the speaker to make an early announcement to head off the impression that he might be a lame duck and therefore in a weaker position to fight the Reagan administration.

Democrats have feared that jockeying over succession to leadership posts, which had already begun, could divide the party only months after it regained a working majority in the House.

"It's great he's put this behind him," said Rep. Tony Coelho (Calif.), head of the Democratic Congressional Campaign Committee. "Now we can go on to other things without worrying who is and is not going to advance in the leadership. O'Neill will go to the 1984 convention as a strong speaker. Whoever is the Democratic nominee must take that into consideration."

O'Neill, much criticized by younger Democrats in 1981 for not providing winnable alternatives to the Reagan program, has taken charge of his troops with noticeably increased enthusiasm this year.

Having learned a painful lesson when southern Democrats on the budget and tax committees co-sponsored Reagan's program in 1981, O'Neill placed loyalists on key committees this year.

Yesterday, in an effort to avoid the divisions of the past two years, O'Neill moved to assert early control over the Democrats' alternative budget. He announced that he would meet with members of the Democratic Caucus, the steering and policy committee, the budget committee and various committee chairmen "to develop a coherent Democratic program...that will offer a better deal to the American people."

Although there is some grumbling in the party over compromising with the White House on jobs and Social Security legislation, O'Neill has made clear that he intends to press for a clearly Democratic agenda and will work with Senate Majority Leader Howard H. Baker Jr. (R-Tenn.) and other Republicans to get it through.

Of late, O'Neill has clearly been relishing his job. A few weeks ago, he made a cameo appearance in the TV sitcom "Cheers," which revolves around a Boston pub, as a favor to the casting director, whose mother is a former O'Neill aide.

He has scheduled a fund-raiser for the spring, "and he wouldn't be doing that if he weren't running again," an aide said.

In a buoyant speech to the Seafarers International Union in Miami recently, O'Neill acknowledged the criticism he had taken during the last Congress.

"It was just two years ago that Time magazine said I was 'on the ropes,' " O'Neill said. "Last month they wrote that I made 'a remarkable political recovery.' Well, I am not any different than I was two years ago, but the House of Representatives is a lot different. It is firmly Democratic."

Coelho gives O'Neill a lot of credit for the 26 new Democratic House members. "The Republicans decided in 1981 to run against Tip," he said. "But we developed the issue of fairness. Tip played it, and the more the Republicans used Tip, the more they helped us. Tip was the Rock of Gibraltar. He became a folk hero."

Kirk O'Donnell, a top O'Neill aide, said, "Tip's looking forward to working with a Democratic president. He wants to continue to be at the forefront of the Democratic comeback, which began dramatically in 1982."