Metric Definition
TDR
Track from
Technical debt ratio
Technical debt ratio is the estimated cost to fix a codebase divided by the estimated cost to build it, expressed as a percentage. It sizes how much of your codebase is effectively owed back as remediation work. A high ratio means a large share of the system needs rework before it can be safely extended.
8 min read
What is technical debt ratio?
Technical debt ratio is the estimated cost to remediate a codebase divided by the estimated cost to build it, expressed as a percentage. If fixing every known issue would take 800 hours and building the system from scratch would take 16,000 hours, the technical debt ratio is 5 percent. Five percent of the value already invested in the codebase is owed back as cleanup before the system is in good shape.
The ratio is a stock measure, not a flow. It tells you how deep the hole is at a point in time, in proportion to the size of the codebase, rather than how fast it is changing. That proportion is what makes it portable. A raw remediation figure of 800 hours sounds alarming for a small service and trivial for a large platform, but the ratio sizes the debt against the asset so the two become comparable.
The ratio matters because it converts a sprawling list of code issues into a single number leaders can act on. Most static analysis tools estimate both the remediation effort and a development cost proxy from lines of code, so the ratio can be computed automatically and tracked over releases. When it climbs, a larger share of the codebase is standing in the way of new work, and the cost of every future change rises with it.
The technical debt ratio is only as good as its two estimates. Remediation cost depends on how issues are sized, and development cost is usually a model based on code volume, not a real build estimate. Keep both methods fixed between releases. The ratio is read as a trend, so a consistent method matters more than a perfectly accurate absolute.
How to calculate technical debt ratio
The ratio divides total remediation cost by total development cost and multiplies by 100. Both figures are estimates, and the way you produce them needs to stay constant from one release to the next so the trend is meaningful. Static analysis tools will compute this automatically, but it is worth understanding the inputs so you can read the result with appropriate scepticism.
- 1
Remediation cost
Sum the estimated effort to fix every outstanding issue: code smells, duplicated logic, missing tests, known defects, and risky complexity. Tools derive this from a fixed time cost per issue type, so the number is only as consistent as that costing model.
- 2
Development cost
Estimate the effort to build the codebase as it stands. This is commonly modelled as lines of code multiplied by an assumed cost per line, which is a proxy rather than a true rebuild estimate. The point is a stable denominator, not a precise one.
- 3
The calculation
Divide remediation cost by development cost and multiply by 100. The result is the percentage of the build investment that is effectively owed back as cleanup before the codebase is healthy.
- 4
Consistency across releases
Use the same costing model and the same scope of issues every time. A ratio that moves because the method changed tells you nothing about whether the codebase improved.
Read the ratio against a target threshold and watch how it moves release over release. A low and stable ratio means remediation is keeping pace with growth. A rising ratio means debt is outgrowing the codebase, which eventually shows up as longer cycle time and slower deployment frequency. The ratio sizes the standing balance, so it pairs naturally with a flow metric that captures how fast that balance is changing.
Technical debt ratio in a metric tree
A metric tree decomposes the ratio into its two halves, remediation cost and development cost, and breaks the remediation half into the categories of debt that make it up. Because the ratio is a proportion, the tree has to explain both terms: the ratio can fall simply because the codebase grew, even when nothing was fixed.
The remediation branch splits into the sources of debt that tools and reviews surface: reliability and security issues, maintainability problems like duplication and complexity, and test-coverage gaps. The development-cost branch represents the size of the asset and provides the context for whether a given remediation figure is large or small. Reading both sides together stops you from celebrating a ratio that only improved because the denominator grew.
This structure makes the ratio diagnosable. If it rises, the tree shows which category of remediation cost grew, whether security findings spiked, complexity crept up, or coverage fell behind new code. Each category sits with a different owner and calls for a different fix, and only a real change in the remediation branch reflects genuine decay.
Metric tree insight
A falling ratio is not always good news. If the remediation branch held steady while the codebase grew, the ratio dropped without any debt being paid down. Always check whether the improvement came from fixing issues or simply from a bigger denominator.
Technical debt ratio benchmarks
A widely cited rule of thumb treats a technical debt ratio under 5 percent as healthy, but the right threshold depends on the maturity and risk profile of the system. Read the bands below as a starting point and watch the direction across releases rather than anchoring on a single figure.
| Band | Technical debt ratio | What it signals |
|---|---|---|
| Healthy | Under 5 percent | Remediation cost is a small fraction of the build. The codebase is in good shape and new work is rarely held up by existing debt. This is the common target for production systems. |
| Manageable | Roughly 5 to 10 percent | Debt is noticeable but contained. Worth a deliberate paydown plan, especially in the parts of the codebase that change most often, before it starts to slow delivery. |
| Concerning | Roughly 10 to 20 percent | A meaningful share of the codebase needs rework. Engineers feel the drag, changes carry more risk, and onboarding takes longer. Remediation should be a planned line on the roadmap. |
| Critical | Above about 20 percent | Remediation cost is a large fraction of the build. The system is hard to change safely and rewrite conversations tend to start. Sustained ratios at this level are a strategic risk, not just an engineering one. |
Treat any single threshold as a guide rather than a verdict. A 12 percent ratio on a stable internal tool that rarely changes is a very different situation from 12 percent on the core service every team builds against. The blast radius of the debt, meaning how often the affected code is touched, matters as much as the headline percentage.
How to improve technical debt ratio
Lowering the ratio means cutting remediation cost in the numerator through genuine fixes, not waiting for the denominator to grow underneath it. Target the categories of debt that surface most often in the analysis and the parts of the codebase that carry the most traffic, because that is where remediation buys back the most delivery speed.
Attack the largest debt category first
Use the tree to find whether reliability, maintainability, or coverage is the biggest contributor, and start there. Spreading effort evenly across categories moves the ratio slowly. Concentrating on the dominant one moves it fast.
Prioritise high-churn code
Remediate the files that change most often, because debt there costs the most in slowed delivery and risk. Cleaning up code nobody touches lowers the ratio on paper without improving how the team actually works.
Stop new debt at the gate
Set a quality gate on new code so the numerator does not refill as fast as you drain it. Requiring coverage and capping complexity on changes keeps remediation cost from climbing release over release.
Pay down in small, steady increments
Reserve a fixed slice of each release for remediation rather than waiting for a big cleanup project. Continuous small reductions hold the ratio down reliably, whereas one-off efforts tend to slip when the roadmap gets busy.
The metric tree approach to lowering the ratio starts by identifying which remediation category is driving the number and which teams touch the affected code most. If security findings dominate, the owner is the team responsible for that surface. If coverage on new code is the gap, the owner is whoever sets the definition of done.
KPI Tree lets you model this by connecting each branch of the ratio tree to the team and the practice behind it. Security owners take the reliability branch, the engineers in the high-churn modules take maintainability, and delivery leads take the quality gate that keeps new debt out. With RACI ownership on every node, a rising ratio is owned by a named accountable person rather than treated as a shared engineering chore. A verified impact loop then checks whether a remediation push actually moved the ratio down, so you can tell genuine progress from effort that quietly refilled elsewhere.
Common mistakes when tracking technical debt ratio
- 1
Trusting the absolute number too literally
Both inputs are estimates, and development cost is usually a model based on code volume rather than a real build figure. Read the ratio as a trend against a consistent method, not as a precise statement of money owed.
- 2
Ignoring the denominator
A growing codebase shrinks the ratio even when no debt is fixed. Always check whether an improvement came from real remediation or simply from the codebase getting bigger underneath the same debt.
- 3
Treating all debt as equal
A security vulnerability and a minor style issue both add to remediation cost, but they carry very different risk. Use the tree to weight by category, not just by raw hours, when deciding what to fix.
- 4
Optimising the ratio in low-traffic code
Cleaning up rarely changed files lowers the number without helping the team. The debt that matters is in the code that changes often, so prioritise by churn, not by what is easiest to fix.
- 5
Measuring the ratio without measuring the flow
The ratio is a snapshot of the standing balance. Without a flow metric showing how fast debt is being added or cleared, you know the depth of the hole but not whether you are still digging.
Related metrics
Cycle time
Process speed
Operations MetricsMetric Definition
Cycle Time = Process End Time − Process Start Time
Cycle time measures the total elapsed time from the start to the end of a process. It is a fundamental operations metric used in manufacturing, software development, service delivery, and any context where the speed of a process directly affects throughput, cost, and customer satisfaction.
Deployment frequency
DORA metric
Operations MetricsMetric Definition
Deployment Frequency = Number of Production Deployments / Time Period
Deployment frequency measures how often an organisation successfully releases code to production. It is one of the four DORA (DevOps Research and Assessment) metrics that predict software delivery performance and organisational outcomes. Teams that deploy more frequently deliver value to users faster, reduce the risk of each individual release, and create tighter feedback loops between development and production.
Sprint velocity
Agile planning metric
Operations MetricsMetric Definition
Sprint Velocity = Sum of Story Points Completed in a Sprint
Sprint velocity measures the amount of work a team completes during a sprint, typically expressed in story points, ideal days, or another unit of estimation. It is a planning tool that helps agile teams forecast how much work they can commit to in future sprints based on their historical completion rate. Velocity is one of the most widely used and most frequently misunderstood metrics in agile software development.
Escalation rate
Customer Support MetricsMetric Definition
Escalation Rate = (Escalated Tickets / Total Tickets Handled) x 100
Escalation rate measures the percentage of support tickets that are transferred from one tier or team to a higher tier or specialist group for resolution. It reflects the gap between the issues customers raise and the ability of frontline agents to resolve them, making it a key indicator of agent readiness, process maturity, and product complexity.
Metric decomposition
Metric Definition
Decompose technical debt ratio into its underlying drivers so you can see which parts of the codebase are pushing it up.
Metric trees for engineering teams
Metric Definition
See how engineering teams place technical debt ratio alongside the delivery and quality metrics it trades off against.
Size your technical debt and pay down what matters
Build a technical debt ratio metric tree that connects remediation cost and codebase size to the teams and owners who can drive the number down.