Code Line Estimator

Enter the combined size of your source files to get a rough line count. The Java reference is 500 lines per 15 KB.

How many lines of code are in 1 MB of Java?

With this Java baseline, 1 MB (1,000 KB) of source code works out to about 33,333 lines.

How the file-size estimate works

Convert the file size to bytes, then divide by 30 and round to the nearest whole line. That ratio comes from dividing 15,000 bytes by 500 lines.

What belongs in the source size?

Add up your uncompressed source files and leave out third-party libraries, generated code, and build output. Formatting and comment density can change the estimate. In a team project, include only the files you wrote if you want a personal estimate.