WASHINGTON — Congressional Republicans who have struggled to accomplish much of anything are now fully invested in quickly pulling off one of the most difficult legislative feats of all — enacting a complicated rewrite of the federal tax code through a proposal littered with political land mines.

With the Senate on Thursday unveiling its companion to the House tax overhaul, Republican leaders began carefully counting votes and calculating what it would take to secure a badly needed victory. Republicans in both the House and Senate believe they can ultimately prevail — though the end result might cost some Republicans their congressional seats next year. But they are not 100 percent certain, and are well aware that the slightest adjustment in the tax proposal to win one vote can just as easily drive off a few others.

“I think it will go through, but who knows?” said Senator Richard C. Shelby, the Alabama Republican who was around for the last major tax fight in 1986. “We will have to wait and see.”

The two Republican plans — no Democrats are actively engaged in the negotiations — differ in substantial respects but share major elements, such as doubling of the standard deduction, increasing the child tax credit and trying to spur economic growth through a cut in the corporate tax rate.