KSLOC Calculator
Size software in thousands of source lines, counted or converted.
In short
Size software in thousands of source lines, counted or converted.
Formula: Line count method: KSLOC = SLOC ÷ 1000. Conversion method: KSLOC = (Function points × Your lines per function point) ÷ 1000
What this calculator does
COCOMO II takes size in KSLOC and documents conversion from functional size using a language-dependent ratio. That ratio must be the organisation's own measured value; the calculator supplies none.
Use it to turn Sizing method, Source lines of code, Function points, Your own lines of code per function point into a checked result you can compare, copy, or rerun with different assumptions.
The page shows the formula, a numeric worked example, and the assumptions that affect this professional & industry calculation.
Inputs and what they mean
- Sizing method
- — Two published ways to reach a size. They are not combined..
- Source lines of code
- — Used by the source-line method..
- Function points
- — Used by the conversion method..
- Your own lines of code per function point
- — Taken from your own codebase in your own language. No conversion table is supplied..
How to use it
- Enter your own figures — the calculator never fills in a rate, price or benchmark for you.
- Press Calculate to see the result.
- Read the formula, variables, assumptions and source below the result before you rely on it.
Formula
Line count method: KSLOC = SLOC ÷ 1000. Conversion method: KSLOC = (Function points × Your lines per function point) ÷ 1000.
Inputs used: Sizing method, Source lines of code, Function points, Your own lines of code per function point.
Edge handling: Source lines of code is required.; Source lines of code cannot be negative.; Source lines of code must be no more than 1000000000.; Function points is required.; Function points cannot be negative..
Worked example
128,400 source lines
- Start with Sizing method: sloc, Source lines of code: 128400, Function points: 0, Your own lines of code per function point: 0.
- Apply the method: Line count method: KSLOC = SLOC ÷ 1000. Conversion method: KSLOC = (Function points × Your lines per function point) ÷ 1000.
- A straight line count; the conversion method stays a separate choice.
Reading the result
The headline figure is the main answer. Any breakdown underneath shows the parts that make it up, so you can check the working and see what changes when you adjust an input.
Limitations and assumptions
- Inputs outside the supported range are rejected rather than forced into a result.
- The result depends on the values you enter for this ksloc calculator; it does not supply missing rates, rules, prices, dates, or assumptions for you.
Reference: University of Southern California, Center for Systems and Software Engineering — COCOMO II model definition manual
Last reviewed:
Common questions
Where does this formula come from?
COCOMO II Model Definition Manual — post-architecture effort PM = A × Size^E × ΠEM with A = 2.94 and E = B + 0.01 × ΣSF (B = 0.91), and schedule TDEV = C × PM^(D + 0.2 × (E − B)) × SCED%/100 with C = 3.67 and D = 0.28. See the source link on this page.
What kind of calculation is this?
Size in thousands of source lines, by either of two published routes. The two routes are separate choices and are never combined.
What are its limits?
Converted sizes inherit all the uncertainty of the conversion ratio. A size, not an effort or a cost.
How do I use the KSLOC Calculator?
Enter the required values for Sizing method, Source lines of code, Function points, Your own lines of code per function point. The calculator applies the formula on this page and shows the main result with any supporting breakdown so you can check the arithmetic.
What formula does the KSLOC Calculator use?
Line count method: KSLOC = SLOC ÷ 1000. Conversion method: KSLOC = (Function points × Your lines per function point) ÷ 1000 The visible formula section above lists the calculation path and the edge cases the page handles, so the result can be checked without relying on the form alone.
Can the KSLOC Calculator be used for exact decisions?
Use it as a calculation aid, not as a substitute for checking the underlying rule, contract, policy, or professional advice that applies to your situation. When a result depends on local rules, personal details, prices, or dates, enter those values yourself and confirm them before acting.
Formula, source and verification
Size in thousands of source lines, by either of two published routes. The two routes are separate choices and are never combined.
The question it answers: What size do I feed into the estimation model?
The formula
Line count method: KSLOC = SLOC ÷ 1000. Conversion method: KSLOC = (Function points × Your lines per function point) ÷ 1000
- SLOC — Source lines of code
- (lines). Counted source lines, used by the line count method.
- FP — Function points
- (FP). Functional size, used by the conversion method.
- g — Lines of code per function point
- (lines/FP). The organisation's own ratio for its own language; no conversion table is supplied.
Units: Lines; thousands of lines; function points.
What kind of calculation this is
Estimation model. This is a published estimation model. It produces an estimate, not a measured fact, and its accuracy depends on how well your situation matches the model.
Method
COCOMO II takes size in KSLOC and documents conversion from functional size using a language-dependent ratio. That ratio must be the organisation's own measured value; the calculator supplies none.
Assumptions built into the result
- Operational: Lines are counted under one consistent counting rule.
Figures this calculator will never guess for you
- No industry delivery rate, productivity figure, defect rate or cost per line is inserted.
- No optional component is filled in on the user's behalf.
- No language gearing factor is provided.
- The two sizing methods are never averaged or combined.
Limitations
- Converted sizes inherit all the uncertainty of the conversion ratio.
- A size, not an effort or a cost.
Source and version
- Standard or reference
- COCOMO II post-architecture model — University of Southern California, Center for Systems and Software Engineering (COCOMO II Model Definition Manual — post-architecture effort PM = A × Size^E × ΠEM with A = 2.94 and E = B + 0.01 × ΣSF (B = 0.91), and schedule TDEV = C × PM^(D + 0.2 × (E − B)) × SCED%/100 with C = 3.67 and D = 0.28.)
- Published source
- University of Southern California, Center for Systems and Software Engineering — COCOMO II.2000
- Formula version
- Version 1
- Verification
- Reviewed against the cited source on
- How much weight the source carries
- Academic
- Applies to
- Currency
- The result is a ratio or index, so it does not depend on currency.
Cite this page
Free Calculator. (2026, September 16). KSLOC Calculator. https://freecalculator.tech/tools/ksloc-calculator
"KSLOC Calculator." Free Calculator, 16 Sept. 2026, https://freecalculator.tech/tools/ksloc-calculator.
KSLOC Calculator — Free Calculator, https://freecalculator.tech/tools/ksloc-calculator
Related tools
Work out the hourly rate to charge a client so that target margin is met after overhead and non-billable time.
Find the true hourly cost of an employee once benefits, payroll cost and overhead are included.
Size a software application from its data and transaction functions before estimating effort or cost.
Estimate development effort, schedule and average team size for a software project of a known size.
Express cloud spend as a cost per customer, per transaction or per other business unit.
Set the rate used to apply manufacturing overhead to jobs for the coming period.