Berkshire Hathaway and Graham Holdings are doing a clever cash-rich split-off — and it’s completely legal.

Happy tax season! In honor of our annual spring ritual, let me show you how utterly bizarre the American tax system can be, using a recent deal between two well-known outfits to illustrate my point. The deal involves Don Graham’s Graham Holdings (formerly The Washington Post Co.) and Warren Buffett’s Berkshire Hathaway, which are doing what’s known in the tax biz as a cash-rich split-off. It’s a way that companies can dispose of holdings on which they have big gains and emerge with cash without technically selling anything, thus incurring no tax bill. Doesn’t that sound like fun?

Why am I amused by this, rather than enraged — the way I am enraged by companies like Apple, which call themselves American but invent repellent (albeit not illegal) ways to artificially suck earnings out of the United States via offshore subsidiaries that don’t have to pay any tax anywhere? Because cash-rich split-offs are specifically allowed by the Internal Revenue Code. Graham Holdings and Berkshire Hathaway aren’t pushing boundaries; they’re using something that Congress has specifically allowed. It’s absurd, but it’s permissible under the tax-code provisions that govern corporate spinoffs, such as the imminent non-game-playing separation of my employer, Time, from Time Warner.

Graham Holdings and Berkshire, which both declined to talk to me, stand to save a total of about $675 million in federal and state income taxes by going the cash-rich split-off route. Graham Holdings is trading cash, Berkshire stock that it owns and a TV station for most of Berkshire’s 23 percent stake in Graham Holdings. (Disclosure alert: I own shares in both companies and am a pensioner of Graham.)

Cash-rich split-offs have become increasingly popular since 2003, when the Janus mutual fund management company did the first one with DST Systems, a data-processing company in which it owned a big stake. Letting companies split into separate parts, tax-free, is a long-standing, rational practice. But now some spinoffs have become tax-avoidance vehicles, in which a business is included merely to make the deal tax-free. For example, in 2007, Time Warner traded cash plus the Atlanta Braves baseball team to the famously taxophobic Liberty Media for Time Warner stock that Liberty owned. The deal was tax-free for both firms.

Here’s how a cash-rich split-off works. Company A puts cash or other “investment assets” plus a business into a subsidiary that it then swaps tax-free to Company B in return for B’s holding of A’s stock. Graham Holdings is ponying up $400,282,183 worth of Berkshire stock that it owns, plus $327,717,817 in cash, for a total of $728 million. It’s also tossing in WPLG, a Miami TV station that the deal values at $364 million — exactly one-third of the $1.092 billion that Graham will give Berkshire. (You’ll see in a bit why I’m being so precise.)

In return, Graham Holdings will get 1,625,747 Graham shares that Berkshire owns. As of March 7, the date Berkshire used in an SEC filing, that stock was worth about $1.144 billion.

Had Berkshire sold those Graham Holdings shares, which cost it about $10 million 40 years ago, for $1.092 billion, it would owe about $425 million in federal and state capital gains taxes. Had Graham Holdings sold the Berkshire stock (estimated cost: $130 million) for $400 million, and the TV station (purchased in 1969 for about $15 million) for $364 million, it would owe about $250 million in taxes. Call the total tax savings $675 million. Plus, Graham Holdings receives a bonus typical of deals like this and gets back shares worth about $50 million more than the assets it’s shelling out.

Tax expert Bob Willens of Robert Willens LLC says Berkshire had best get Graham Holdings to reduce its cash payment by $1 when the deal closes. That’s because the tax code says the operating business has to be “somewhat more than a third” of the total price, not the exact third indicated in the Berkshire filing. Willens, with a chuckle, says he won’t bill anyone for the advice.

And that will do it. Many happy returns to you and yours. 

Marty Jones contributed. Sloan is Fortune magazine’s senior editor at large.