Texas Gov. Rick Perry’s tax plan is an attempt to solve a problem that no Republican has yet overcome: how to make a flat tax politically palatable. The result he came up with is a proposal that is neither flat nor attractive.

Perry’s mistake wasn’t in choosing the wrong details for his plan. It was in taking on an impossible mission. For all its superficial appeal, the flat tax cannot be made politically viable.

In 1996, Steve Forbes made a relatively pure flat tax — with no deductions for charitable contributions or mortgage interest, let alone for anything else — the centerpiece of his campaign for the Republican presidential nomination. Many conservatives swooned over the idea, regarding it as simple, fair and pro-growth.

But the other Republican candidates quickly exposed its flaws. Chief among them was that replacing a progressive income tax with a flat tax necessarily means slashing revenues, raising middle-class taxes or both.

Set the new flat rate at a level that can raise as much money as the current tax code and the middle class will pay more. People in the middle of the income spectrum, that is, will have to make up for the sharp fall in rates on high earners. Set it low enough that middle-class taxpayers pay the same as they do now and revenues drop. The only way around this dilemma is to assume that the flat tax will cause an implausibly large boost to economic growth.

These drawbacks explain why no Republican presidential nominee — or even a serious candidate for the nomination since Forbes — has campaigned on the flat tax. Ambitious Republicans have at most said they want a “flatter” tax code.

Until Perry. His plan, which he calls “Cut, Balance, and Grow,” avoids tax increases on the middle class in three ways. Like Forbes’ 1996 plan, Perry’s would set the personal exemption levels very generously: A family of four wouldn’t start incurring income-tax liability until after their first $50,000 in income. But Perry adds two new wrinkles. Taxpayers would get to choose whether to file under the current tax code or the new flat system. And even in that new system, the most broad-based tax breaks would continue. Mortgage interest, charitable contributions, and state and local taxes would all be deductible.

And so the plan isn’t particularly simple. Anyone who would have to pay higher taxes under Perry’s “flat” code could simply choose to file under the current system. Most people will thus end up calculating their tax liabilities twice. Many will have to do it three times because Perry’s plan doesn’t eliminate the alternative minimum tax. The price of avoiding one of the traditional disadvantages of the flat tax is giving up one of its chief appeals.

Nor is Perry’s tax very flat. It isn’t flat with respect to income: Because of the exemptions and the choice of tax plans, average rates rise with earnings. It isn’t flat with respect to geography: Because of the deduction for state and local taxes, people in high-tax Illinois would get a subsidy from low-tax Texas. It isn’t flat, finally, with respect to economic choices: It continues t o reward taxpayers for taking out big mortgages.

Perry’s plan is, in short, a flat tax in name only. And notwithstanding his campaign’s absurdly optimistic projections, it seems likely that it would result in much lower revenues than the current system.

How could it not? The vast majority of people who would choose the new flat tax would be people who would pay less under it. And some of those people would pay a lot less.

If you were designing a tax code from scratch, you wouldn’t come up with anything as convoluted and inefficient as our current system. But if you were trying to improve the tax code, you wouldn’t come up with Perry’s plan, either. You’d only come up with it if you started with the imperative to propose something you could call a “flat tax” and then modified it as you went along to protect yourself politically.

Within those constraints, Perry’s plan makes perfect sense. An optional flat tax is politically safer than a mandatory one. A flat tax that keeps the biggest deductions is safer still.

It’s just that the result makes little sense. A plan that simply cuts the tax rate on high earners (and on capital gains, dividends and estates) would have all the economic advantages of Perry’s proposal with none of the conceptual headaches. Were Perry to become the nominee, President Barack Obama would probably say Perry’s plan is a way to complicate everyone’s lives in order to cut taxes for the rich. And he would be right.

Forbes’ campaign suggested that a pure flat tax can’t attain enough popularity to get enacted. Perry’s campaign is proving the corollary: The flat tax can’t be modified into popularity, either. The flat tax may seem simple, efficient and appealing, but it’s the fool’s gold of conservative politics.

Ramesh Ponnuru is a Bloomberg View columnist and a senior editor at National Review.