Lines of code (LOC) is a software metric used to calculate the size of a software program by counting the number of lines in the text of the program's source code. LOC is typically used to predict the quantity of effort that will be neded to develop a program, as well as to estimate programming productivity or effort once the software is produced.