Working as a freelancer has a number of benefits. You can set your own hours, dictate your own dress code (pajamas, anyone?), and work from whatever location you find most convenient. But if there's one major downside to freelancing, it's that steady income can be hard to come by. Here are four major financial mistakes to avoid in light of that reality.

1. Not having an emergency fund
Most people need to store at least three months' worth of living expenses in an accessible savings account, and if you're a freelancer, you should have a higher balance than the average worker. To offset your less-than-steady income, you'll need about six months' worth of living expenses or more earmarked for emergencies -- which means that if you typically spend $5,000 a month, your goal should be to have $30,000 readily available for whenever you might need it. If you own a home or have children (or other dependents), then you may want to aim even higher. While it's true that emergencies can happen to anyone, the less predictable your income is, the more protection you'll need.

2. Not saving for retirement
Just because you don't work for an employer who offers a 401(k) doesn't mean you can't save for retirement. While you won't get to take advantage of an employer match, you have several tax-advantaged retirement accounts to choose from. You can set up a solo 401(k) and contribute up to $18,000 in pre-tax dollars per year ($24,000 if you're 50 or older). You also have the option of opening a traditional or Roth IRA, which lets you contribute $5,500 per year ($6,500 if you're 50 or older). Traditional and Roth IRAs come with different tax advantages, so read up and figure out which is best for you.

There's also the SEP IRA, which lets you contribute the lesser of $53,000 or 25% of your income in pre-tax dollars. Now if you're earning $60,000 per year as a freelancer, you may not be able to set aside $15,000, or 25% of your income, for retirement. But even a few thousand dollars a year can go a long way. If you start investing $5,000 a year at age 30 and manage to generate an 8% average annual return, which is a bit below the stock market's average, by then you'll have a whopping $860,000 by age 65.

3. Not keeping track of receipts and mileage
As a freelancer, you're allowed to deduct certain costs of doing business from your taxable income. Cell phone and Internet service, for example, are two common deductions for freelancers to take. Similarly, if you use your car for work purposes, you may be eligible to deduct your mileage. But to claim these deductions, you can't simply guess at the amounts. If you fail to hang onto your receipts or keep an accurate mileage log, and you make a mistake on your taxes as a result, you could be in trouble if your return gets audited. To avoid this problem, create a filing system for your receipts and payment records, as well as an electronic mileage log that you commit to updating weekly. You should also scan your receipts regularly so that you'll have an electronic record of them as well. A few extra minutes of housekeeping each week can help you avoid a huge hassle come tax time.

4. Not having health insurance
Paying for health insurance can be a drag, especially if you rarely need medical care. But forgoing health insurance can cost you in more ways than one. First, you'll be penalized if you fail to obtain coverage, which means paying either a preset fee or 2.5% of your household income, whichever is higher. For 2016, the fee is $695 for an adult and $347.50 per child under 18, for a total of up to $2,085 per family. Secondly, if you encounter a medical emergency and don't have insurance, you could wind up on the hook for a bill large enough to induce a heart attack itself. The average Obamacare premium in 2016 is $408 per month, or roughly $4,900 for the year. While that may seem like a lot, an unexpected hospital stay could easily cost you two or three times that amount if you don't have insurance, and that's not a chance you want to take.

Remember, there's inherent risk involved in being a freelancer, and the best way to counteract it is to make smart financial decisions from the get-go. That way, you can enjoy the perks of making your own schedule and rules, even during those times when you're waiting impatiently for paychecks to start rolling in.

Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.