What is the estimated number of lines in all current US federal laws?
I realize that this metrics isn't accurate. Which font size do we use?
Do we include comments? How to count someone v. United States?
U.S. federal law consists of:
52 Titles of the United States Code (some of which have more than one volume) and a smattering of uncodified statutes that probably would take up one or two additional books. On the order of 100 volumes.
About 2 volumes worth of federal court rules of general applicability.
About 200 sets of local court rules for particular federal courts. On the order of 20 volumes for the whole set.
About 2000 volumes of the Federal Reporter which sets forth published appellate court decisions.
About 2150 volumes of the Federal Supplement which sets forth selected federal trial court opinions.
On the order of 500 volumes of the Federal Rules Decisions which sets forth selected trial court opinions interpreting court rules.
582 volumes of the United States Reporter which sets forth U.S. Supreme Court decisions.
A set of U.S. Treaties in Force on the order of 20-30 volumes.
The Code of Federal Regulations (50 titles, some of which have more than one volume). On the order of 200 volumes.
Several hundred treaties with U.S. Indian tribes, probably about 20 volumes.
About 500 volumes of territorial legislation still in force (e.g. statutes of Guam, Puerto Rico, U.S. Virgin Islands, District of Columbia, Indian reservations).
So, this would mean roughly 4500 volumes that have about 1000 pages of text each for a total of 4,500,000 pages, typically single spaced in 10 point (10/72nds of an inch) font on letter sized paper with half inch margins (i.e. 7.5 inches for text per page top to bottom) which works out to on the order of 50 lines per page.
So, roughly, 225 million lines of code equivalent for primary federal materials only.
There are some judgment calls about definitions here. For example, I did not include the full text of all works deposited with the library of Congress as part of the documentation of copyrights, or the full text of all patents and trademarks ever issued, each of which would dramatically increase the total, even though reference to those materials is necessary to determine if another work infringes a copyright or patent. Similarly, I omitted recorded real estate documents and publicly filed corporate documents even though those could each be referenced as evidence in a court case to determine someone's legal rights. And, I didn't include court orders in trial courts with no precedential effects which are binding between the parties even though some consent decrees in that set of documents have the force of law.
Of course, the problem is that U.S. federal law isn't an independent body of law by itself, by design. U.S. federal law routinely incorporates the law of the state in question by reference. For example, criminal liability in federal parks is determined in part by reference to state law.
A full set of state statutes and regulations in a typical U.S. state would require perhaps 50 volumes for a total of about 2500 volumes, and the entire corpus of published state level case law for all states combined is on the order of 10,000 volumes. So, excluding municipal ordinances, you are looking at another 12,500,000 pages at 50 lines a page, for about 600 million lines of code. Local government ordinances are litigated in state court so there is no separate body of case law for them.
But, there are about 100,000 local governments and there are probably about 2 volumes of law for each, so about 200,000,000 pages and about 1,000 million lines of code.
I'm sure I've made some minor omissions (e.g., case law from the courts of U.S. Indian Tribes), but the grand total for all U.S. law local, state and federal is on the order of 2 billion (i.e. 2,000,000,000) lines of code.
Also, keep in mind that this is only the primary materials and doesn't include treatises and textbooks and digests and law review articles interpreting the law which you need in practice to utilize this corpus of primary legal materials, and which can be referenced by courts in cases. On the other hand, secondary sources are profoundly less redundant than primary sources. You could have a pretty comprehensive collection of secondary sources with 2,000 volumes which would be about 2,000,000 pages and about 100 million lines of code which could be rolled into the omitted materials in my 2 billion lines estimate.
Of course, this is highly redundant. Case law spends lots of time reciting rulings from prior cases and the language of the relevant statutes and regulations, for example, and many municipal ordinances start out with an exact copy of another municipality's municipal ordinances before the municipality starts writing its own original legislation. Similarly, state traffic codes are often copied from one another. Also, not every reported case continues to be good law. But, there is no good way to separate the wheat from the chaff for a user of these legal authorities. You need them all.