It costs a lot of money to work for yourself.

On the one hand, self-employment comes with freedom. If you want to sleep in on a Wednesday, go ahead and do so. If you don't want to take a given project or client, it's your call whether to accept their money. No one looms by your office to "ask" if you can work over the weekend. (Although you probably will anyway.)

On the other hand, self-employment triggers an unavoidable 9% tax hike. (Yes, seriously. It's called the self-employment tax.) It means paying for your own equipment and expenses, and doing all the jobs for yourself that a business typically hires specialists for. (You've never appreciated just how hard the salespeople work until you've had to find your own clients.)

And you have to fund your own retirement. No pension. No company 401(k). No matching contributions. Just whatever monthly allowance you give your 65-year-old self.

That's where Keogh plans come in handy for a very specific set of people.

What Is a Keogh Plan?

A Keogh plan is an archaic form of tax-advantaged retirement plan for self-employed workers or very small business owners. In function, they're somewhere between a solo 401(k) and a self-funded pension account. According to the IRS:

Retirement plans for self-employed people were formerly referred to as "Keogh plans" after the law that first allowed unincorporated businesses to sponsor retirement plans. Since the law no longer distinguishes between corporate and other plan sponsors, the term is seldom used.

While once-popular, changes to the tax code in 2001 have made Keogh plans largely obsolete. Instead, most self-employed workers rely on SEP IRAs, a form of self-funded retirement account with higher contribution limits than traditional IRAs. Nevertheless Keogh plans still exist, although they're often referred to as H.R. 10 plans these days and rarely make sense for anyone but the very highly paid.

How Does a Keogh Plan Work?

Like a 401(k) or an IRA, a Keogh plan allows you to invest pre-tax money in your retirement account. This means that you can deduct every contribution you make from your taxable income up to a specified limit (defined by your specific plan).

Also like a 401(k) you will pay taxes on this money once you begin to withdraw it, which must happen no sooner than age 59½ and no later than age 70. Withdrawing money earlier than this will trigger early distribution tax penalties of 10% plus all applicable normal income taxes. Not beginning to take money out at age 70 will trigger a tax penalty of 50% of the minimum required withdrawals.

What Are the Types of Keogh Plans?

There are two types of Keogh plans that someone can set up: defined-contribution and defined-benefit.

• Defined Benefit Plans

A defined benefit plan works much like a traditional pension account except that you establish and fund it yourself.

Under this plan you will set the annual pension that you'll receive upon retirement. This benefit can't be more than $225,000 a year as of 2019. Then you will create a formula for how much you have to contribute to your retirement account every year in order for it to fund that pension, based on factors such as income, anticipated returns and anticipated age of retirement.

There are no contribution limits to a defined-benefit Keogh plan. The only limit is how much you can plan to receive in benefits. If that means contributing $75,000 per year, and you've got the means to do so, then the IRS will allow it.

Readers should note that some sources indicate that these plans have a contribution limit. This is inaccurate. According to the IRS: "Contributions are calculated by an actuary based on the benefit you set and other factors (your age, expected returns on plan investments, etc.); no other annual contribution limit applies." (Emphasis added.)

• Defined Contribution Plans

There are two types of defined contribution Keogh plans.

The first is called a Profit Sharing Plan. Under this model you can contribute a discretionary amount of money to your retirement account each year up to either 25% of your total compensation or the annual cap, whichever is less. (In 2019 the cap is $56,000.) Despite the name, you don't actually need to generate profits to use a profit sharing plan, however if you are a small business with multiple employees you must use the same formula when determining contributions to all employee retirement plans.

You can use a profit sharing plan alongside other retirement plans.

The second type of defined contribution Keogh plan is called a Money Purchase Plan. Like a profit sharing plan, under a money purchase plan you would make an annual contribution based on your business' revenues. For example, you might contribute 5% of business income each year, or 10% of each employee's compensation.

Unlike a profit sharing plan this contribution is not discretionary. When you establish the plan you will also specify what contribution you will make each year. If you fall below this contribution you will face excise tax penalties.

Money purchase plans have the same cap as profit sharing plans: the lesser of 25% of total compensation or the annual cap ($56,000 in 2019). You can establish a money purchase plan alongside other retirement plans.

Who Is Eligible for a Keogh Plan?

A Keogh plan is generally for people who are self-employed or who work for small businesses. Any small business owner who establishes a Keogh plan for themselves must also do so for any employee that meets the hourly requirements (as of writing this meant all employees who have worked for the business for at least two years for at least 1,000 hours a year).

To establish a Keogh plan you must be a sole proprietorship, a partnership, a limited liability company or a corporation. An independent contractor/freelance worker cannot set up a Keogh plan, nor can one member of a partnership do so independently. A self-employed individual can set up a Keogh plan but they must do so through a formally established business.

Advantages and Disadvantages of a Keogh Plan

Keogh plans have generally fallen out of favor since the IRS established modern IRA rules. Among other downsides, these plans have higher administrative costs and more administrative burdens than most other forms of retirement plans. In particular, money purchase plans and defined benefit plans are quite restrictive in how they require you to make contributions. Further, all Keogh plans require annual reporting to the IRS, which only adds to the costs of managing this type of retirement account.

By contrast, SEP IRAs and SIMPLE IRAs offer a substantially similar structure to a Keogh plan. Self-employed people or employees in a business can make contributions to a retirement account using pre-tax dollars. However both forms of IRA come with less paperwork and fewer administrative costs, making them the generally preferred option.

Meanwhile, a Keogh plan requires that you (the employer) make the only contributions. While you must offer the plan to all qualifying employees, they're not allowed to pay into it. This is generous but as a result most businesses find that matching contributions to a 401(k) make much more sense as an employee retirement benefit.

The main advantage of a Keogh plan is that it has far higher contribution limits than any other form of retirement account. In fact, virtually no other tax-advantaged retirement account can match the generosity of a defined benefit Keogh plan.

As a result, Keogh plans tend to have a very specific demographic. If you are self-employed, run a very small business or are part of a partnership and if you are high income, a Keogh plan might be right for you. This is, for example, a potentially useful plan for doctors or lawyers working in solo or small practices, as it will let them set aside far more of their income than they could under any other model.

For most businesses, however, a 401(k) likely makes more sense. For most self-employed workers, the IRA is probably a better option.

It's never too late - or too early - to plan and invest for the retirement you deserve. Get more information and a free trial subscription toTheStreet's Retirement Dailyto learn more about saving for and living in retirement. Got questions about money, retirement and/or investments? We've got answers.