Should you build it or buy it? it’s a timeless debate in the world of software. All too often, you might be tempted to write some code and build something “just right” instead of buying—or using, in the case of open source—something off the shelf. In some cases, this is a perfectly good decision, but more often than not, it’s a rabbit hole.

As a developer, it’s tempting to underestimate the effort to roll your own tools; as a founder without extra cash lying around, “free” is a tempting proposition. But, as a business owner, you have to step back and look at the bigger picture. You can’t afford to play around and hack for days, when spending a little cash solves the same problem in hours or minutes. Well, you can, but you’ll hamstring your business.

First, it starts with a bug tracker. Then you’re running your own email server. Then you’ve custom-built a business intelligence tool. Maybe you’re self-hosting your newsletter software. Then, at a minimum, you’re paying for the servers to host these tools, and you have to find time to keep up with security updates. Before you know it, you’re spending more time on the tools you’ve built to run your business than the business itself. Keeping your primary application secure, updated, and well monitored is difficult enough. Add in a handful of other applications, and you’ll quickly see why so many companies opt to pay monthly for SaaS tools.

How do you know when it makes sense to build that tool instead of just paying for the existing option? The simplest litmus test is whether it’s a strategic investment that significantly differentiates your business from others. Does it build a moat that others can’t or won’t take the time to replicate? If so, then there’s a chance it makes sense–but it’s still only a chance.

For instance, should you run your own mail server or outsource it to an email service provider? Other than saving a little cash, running your own mail server won’t give you a competitive advantage over another business that outsourced its email. It might even be a disadvantage unless you specialize in email delivery.

On the other hand, if you have a unique approach to pricing in your industry, outsourcing your payment processing to the company all your competitors are using won’t make sense if it forces you to make concessions on how you price your product. If building a custom billing system enables you to move faster or remove pain for your customers, then you might have a good case for the investment.

Of course, strategy is only one component. Price is the more obvious challenge, but it’s too easy for the hidden costs of building to make it look more cost-effective than it really is. When you factor in hourly rates, initial development, long-term maintenance, and opportunity cost, building your own tools quickly becomes expensive.

Even if building something only takes you one day and then averages a day per year of maintenance, that’s at least $600 per year of development effort. That’s not even factoring in opportunity cost. You could spend $50 per month on a tool and break even. Of course, the number of tools you can build and maintain with one day per year is pretty slim.

At one month of effort based on a $150 per hour rate, you’re looking at over $20,000 of investment. At two months, you’re over $40,000 of investment. And those are just the up-front costs without factoring in long-term maintenance. Is it really worth it? Are you sure there’s not a tool out there that will do 90% of it for a fraction of the effort or cost?

As a developer, it’s easy to view problems in terms of code to be written, but as a business owner you have to recognize when it’s all right to throw cash at a problem. Don’t get bogged down building ancillary tools. Focus obsessively on only writing code that provides value to your customers and creates unique competitive advantages for your business.

Baremetrics Build vs. Buy Calculator Baremetrics has created a straightforward calculator to help you determine whether it makes financial sense to roll your own piece of software or pay for an existing option.