All posts

Software rewrite cost: what drives the price

Made Right Software builds MVPs and custom software for founders and small business owners, and audits or rescues code that already exists. Fixed price. Delivered in 4 to 10 weeks.

Your engineering team wants to rewrite the codebase from scratch. The estimate says 18 months. The real timeline usually runs longer, and the cost grows with it. We call the extra cost the rebuild tax. This article puts numbers on what a rewrite costs, why most of them fail, and what to do instead.

The rebuild tax is more than the engineering salaries. Opportunity costs come from features you never ship. Hidden costs come from knowledge you lose and customers who churn. The market keeps moving while your team rebuilds features the old system already had.

Why do rewrites seem like the answer?

The existing codebase looks like a disaster. Six different developers touched it. The original architect left 18 months ago. Nobody understands the authentication flow anymore. Technical debt compounds daily. New features take twice as long as they should.

Starting fresh feels obvious. Write clean code. Use modern frameworks. Build it right this time. The team gets excited. Morale improves from making the decision.

This feeling is a trap.

Reading code is harder than writing it. When you look at someone else’s work, you see mess. When you write your own code, you see elegance. The difference is familiarity, not quality. That messy codebase contains three years of solved problems. Bug fixes for edge cases you forgot existed. Workarounds for integration quirks that aren’t documented anywhere.

Engineers want rewrites for predictable psychological reasons. They want new technology on their resume. They distrust code they didn’t write themselves. They believe they won’t make the mistakes the previous team made. Every new codebase looks cleaner than the old one at first. Then reality catches up.

What does a rewrite actually cost?

The direct costs are easy to calculate. Suppose eight engineers cost $150,000 each per year, fully loaded, for an 18-month rewrite. Salaries come to $1.8 million. Add $75,000 for staging environments, data migration tools, and testing. Direct cost is $1.875 million for a mid-sized application.

That number is wrong. It ignores opportunity costs.

During those 18 months, you ship no new features. Competitors keep shipping. Customer requests pile up in your backlog. Sales cycles slow because prospects ask about roadmap items that keep getting delayed. Suppose the company has $5 million in annual recurring revenue and the delay costs 15 percent of one year’s revenue in deals that slip or disappear. That comes to $750,000.

You also maintain two codebases simultaneously. The old system still runs in production. Customers still report bugs. You fix them in the legacy codebase because the rewrite isn’t done yet. Part of every sprint goes to the system you are replacing.

Hidden costs hurt more than budget overruns. Team turnover spikes during long rewrites. Engineers get frustrated. The exciting new project turns into a grind. One or two senior developers leave. Replacing them takes recruiting, interviewing, and a long ramp-up. They take institutional knowledge with them.

Put the pieces together. Direct costs come to $1.875 million and opportunity costs to $750,000. The example reaches $2.625 million before hidden costs from turnover and knowledge loss are counted.

Scale the example up for a growth-stage company. Twenty engineers for 24 months come to $6 million in salaries at the same assumed rate, before opportunity and hidden costs.

Why did Netscape lose the browser war?

Netscape decided to rewrite its browser from scratch. In Things You Should Never Do, Part I, Joel Spolsky wrote that the last major release, version 4.0, “was released almost three years ago.” He also wrote that Netscape’s market share “plummeted” during that time.

The essay’s argument turns on a simple observation. “It’s harder to read code than to write it.” Old code holds fixes that nobody on the new team wrote or remembers.

What happened to Digg?

Digg released version 4 in August 2010. TechCrunch called it “a 100% rewrite.” Its design, code, architecture, and infrastructure were all new.

According to Wikipedia’s history of Digg, the launch was marred by site-wide bugs and glitches. Following the redesign, Digg experienced a mass exodus of users to Reddit.

The 2012 sale of Digg’s brand, website, and technology followed the troubled version 4 launch. Inc. reports that Betaworks acquired them.

The lesson isn’t about technology choices. Users don’t care what framework you use. They care about features working reliably.

Why do rewrites fail so often?

The 1995 Standish Group CHAOS report found that 16.2 percent of software projects finished on time and on budget. The report covers software projects generally, not rewrites specifically. It illustrates the difficulty of meeting software project schedules and budgets.

The first problem is underestimating complexity. Original code reflects business reality. That “unnecessary” conditional statement may handle an edge case someone fixed after a production incident. Nobody remembers why it’s there. You remove it in the rewrite. Months after launch, the same issue surfaces again. You pay for that lesson twice.

Chesterton’s Fence principle applies directly. Don’t remove a fence until you know why someone built it. Legacy code is full of fences. Each one solved a real problem. Rewrites remove fences without understanding their purpose.

Fred Brooks described the second-system effect in The Mythical Man-Month, first published in 1975. When developers get a chance to rebuild, they try to fix everything. Feature creep explodes. “While we’re at it, let’s also add…” becomes the project killer. Scope grows. Timelines extend. The simple rewrite becomes a multi-year odyssey.

The moving target problem makes everything worse. Your original system keeps evolving during the rewrite. Customers request features. Competitors launch capabilities you need to match. Sales needs something specific to close a deal. You add these features to the old codebase because the rewrite isn’t ready. Then you have to replicate them in the new system. You never catch up.

Technical debt extends beyond code. Organizational processes built around the existing system. Customer workflows that depend on specific behaviors. Integration quirks with third-party services. Documentation and training materials. The rewrite invalidates all of this institutional knowledge simultaneously.

How much would your rewrite actually cost?

Consider an example. A team of 12 engineers estimates 12 months for a rewrite. The estimate allows one month for planning, six for core development, three for feature parity, and two for testing and migration. In this example, the work takes 24 months, for four reasons.

The planning phase takes three months in this example, not one. You need detailed specifications. Architecture decisions. Technology choices. Database schema design. API contracts. Migration strategies. This work can’t be rushed without causing problems later.

Core development takes 12 months in this example, not six. Everything takes longer than estimated. Integration with third-party services has hidden complexity. Data migration reveals edge cases in production data that don’t exist in development databases. Performance optimization requires multiple iterations.

Feature parity takes six months in this example. Users depend on capabilities you forgot about. Reports nobody mentioned in requirements. Keyboard shortcuts power users rely on. Email notification preferences. These “small” features multiply into months of work.

Testing and migration take three months in this example. You need parallel running to verify correctness. Data migration for millions of records with validation. Rollback procedures in case something breaks. Training for support teams. Documentation updates.

The 24-month timeline puts eight of the twelve engineers on the rewrite full time. At $150,000 loaded cost per engineer per year, salaries come to $2.4 million. Infrastructure and tools add $100,000. Project management and DevOps support add $200,000. Direct costs total $2.7 million.

Opportunity costs scale with company size. Suppose the company has $10 million in annual recurring revenue and the rebuild costs 15 percent of one year’s revenue in deals that slip or disappear. That comes to $1.5 million. Competitors gain ground while sales cycles lengthen.

Hidden costs compound. Suppose two senior engineers leave during the rebuild. Replacing them takes recruiting, interviewing, and ramp-up time the budget did not include. Knowledge loss means solving problems twice. Regression bugs in the new system can drive customers away. Integration rework for each third-party service adds more time.

Direct and opportunity costs reach $4.2 million in this example, before hidden costs. Suppose the original system cost $2 million to build. At $4.2 million, the rebuild already costs more than twice the original system.

What should you do instead?

Martin Fowler documented the strangler fig pattern as a gradual alternative to big bang rewrites. The name comes from strangler fig trees that grow around existing trees. Eventually the fig tree replaces the original completely. Fowler also notes that replacing a serious IT system takes a long time.

You identify one problematic module. Extract it into a new service. Rebuild that service with modern technology. Route traffic to the new version. The old system keeps running. When the new module works reliably, remove the old code. Repeat for the next module.

Risk is lower because you ship value in pieces. The team keeps delivering features while the migration runs. Velocity does not drop to zero.

The migration runs longer on paper. That sounds worse until you account for the delays and scope creep that a full rewrite usually picks up. The difference is that the strangler approach delivers value throughout the process instead of at the end.

Incremental refactoring offers another path. Apply the Boy Scout Rule during regular feature work. Leave code cleaner than you found it. Refactor the module you’re working on before adding new functionality. The overhead stays small. Improvements compound over time without dedicated rewrite projects.

Strategic rewrites target specific pain points. Rebuild the checkout flow because it blocks revenue. Keep the user management system because it works fine. Rewrite the reporting engine because it can’t scale. Don’t touch the notification system because nobody complains about it.

This focused approach puts the work where it matters most. The rest of the system keeps working. Choosing between different development approaches matters less than choosing the right scope.

Before committing to a rewrite, a code audit can tell you which parts to rebuild and which to keep. A software project rescue stabilizes the current system while that decision is made.

Should you actually rewrite?

Start with a code audit and identify the parts that block the next year of product work. Compare a targeted rewrite with a gradual migration before committing to replace the whole system. Include the cost of keeping the current system running while the replacement is built.

What happens after the rewrite?

Assume the rewrite succeeds. You launch on time. Performance is better. Code is cleaner. Developers are happy. What happens next?

Technical debt starts accumulating immediately. Pressure to ship features returns. Quick fixes get merged. Edge cases get handled with conditional statements. Integration quirks get worked around. Over time, the new codebase looks surprisingly similar to the old one.

The pattern reflects reality, not failure. Codebases reflect business complexity. Business complexity doesn’t decrease because you rewrote the code. The mess comes from the problem domain, not from bad developers. Different teams working on the same product for the same amount of time end up with similar levels of complexity.

Understanding this changes the cost-benefit analysis. You’re not paying for a permanent solution. You’re paying for a reprieve whose length nobody can promise. Sometimes that makes sense. Usually it doesn’t.

Who actually benefits from rewrites?

Consultants benefit. Rewrite projects are large, complex, and long-running. They generate significant revenue. Agencies that specialize in modernization work have strong incentives to recommend rewrites over incremental approaches. This doesn’t make them wrong, but it creates bias.

Engineers benefit in the short term. Resume-driven development is real. Developers want experience with popular technologies. Maintaining a legacy Java application doesn’t help career advancement like building a new system with TypeScript and React does. This motivation is understandable but rarely aligns with business needs.

Technology vendors benefit. Database companies, cloud providers, and framework creators all benefit when companies adopt their latest offerings. Marketing emphasizes greenfield projects using new technology. Case studies focus on the rewrite and skip the incremental work.

Who doesn’t benefit? Companies paying for the rewrite. Shareholders funding the opportunity cost. Customers waiting for features that never ship. Employees who leave because rewrite projects turn into death marches.

The incentive structure explains why rewrites happen despite poor track records. The people making recommendations benefit from the decision. The people paying the costs don’t make the decision until it’s too late to reverse course.

How do you fix this?

Change the default answer. Rewrite proposals should start with “no” unless proven otherwise. Make advocates provide hard data showing alternatives won’t work. Measure maintenance costs monthly. Track velocity trends quarterly. Quantify performance impacts on revenue annually. Assumptions aren’t enough.

Calculate opportunity costs explicitly. List every feature on your roadmap. Estimate revenue impact for each one. Show what you’ll sacrifice during a rewrite. Make the tradeoff visible. Leadership makes better decisions when costs are concrete, not abstract.

Set kill criteria before starting. Define what failure looks like. If timeline exceeds 150 percent of estimate, stop. If budget exceeds 200 percent, stop. If three senior engineers leave, stop. Commit to these criteria in advance. Sunk cost fallacy makes it almost impossible to stop once you’ve invested millions.

Budget for parallel maintenance explicitly. Assume a fixed share of every sprint goes to the old system during the transition. Double your support team capacity. Plan for bug fixes in both codebases. Factor this into cost estimates. Most rewrite proposals ignore parallel maintenance completely.

Preserve institutional knowledge actively. Document why things are the way they are. Record decisions about edge cases. Explain workarounds for integration problems. Treat this documentation as critical as the rewrite itself. Knowledge loss causes many regression bugs after launch.

The core insight is simple. Rewriting is rarely the best option. It feels right because starting fresh is emotionally satisfying. The math rarely supports the emotion. Strangler fig patterns, incremental refactoring, and strategic rewrites usually deliver better returns with less risk. Making that choice requires overcoming psychological bias toward clean slates.

What to do next

Rewrite only when the current system blocks the next year of product work and a strangler migration has been costed. If the system only slows the team down, fix the slow parts first and measure what changes.

Software rewrites fail because the problem isn’t technical. It’s organizational, psychological, and economic. Technical solutions can’t fix non-technical problems. Companies that understand this stop paying the rebuild tax. They invest in incremental improvements instead. They ship features while competitors rewrite. They win by avoiding the trap entirely.