Code Line Estimator
Enter your total source file size to estimate lines of code using a Java baseline of about 500 lines per 15 KB.
How many lines of code are in 1 MB of Java?
At about 500 lines per 15 KB, 1 MB of similar Java source (1,000 KB) comes to roughly 33,333 lines.
How do you convert file size to lines of code?
Convert the total size to bytes, divide by 15,000, multiply by 500, and round to a whole line. Language, formatting, and comment density affect the estimate.
Which files should you include?
Use the uncompressed size of your source files. Leave out dependencies, generated files, and build output. For a personal estimate, use the size of files you wrote. A shared project’s total size cannot tell you who wrote what.