How many halachot are detailed in the Mishneh Torah?
To clarify, I am interested in the counting of the author's (i.e. if the Mishneh Torah details two rules under one halacha that counts as one and not two).
How many halachot are detailed in the Mishneh Torah?
To clarify, I am interested in the counting of the author's (i.e. if the Mishneh Torah details two rules under one halacha that counts as one and not two).
According to Mechon Mamre:
TL;DR
TOTAL - 16,818 (+ 104)
Array.from(document.querySelectorAll("b")).filter(function (n) { return n.innerHTML.match("^.{1,2},.{1,2}$") !== null; }).length;
One simple way to calculate the number of halachot in Mishneh Torah is to use the URLs in the version on Hebrewbooks. Each halacha has a unique URL ending in a number, with the first halacha starting with the number 1. Each URL increases by one from the previous URL. Thus, the URL of the very last halacha in Mishneh Torah contains the total number of halachot. In this case we can see that it comes out to 15,024 halachot.
Of course, as R. Yosef Qafih already noted in the introduction to his edition of Mishneh Torah, there are differences in the numbering of the halachot between different versions:
הנוסח הוא על פי כתבי היד וכך גם חלוקת ההלכות נעשתה על פי רוב כתבי היד וקטעי כתבי היד שברשותי והואיל והספרות התורתית העולמית מציינים בספריהם מספרי ההלכות כפי שמופיע בדפוסים לא יכולתי להתעלם מהם לגמרי כדי שלא להקשות על המעיין למצוא דברי חפץ לפיכך עשיתי את המספרים אשר על פי כתבי היד תוך סוגרים מרובעים [ב] ומספר ההלכות על פי הדפוסים תוך סוגרים עגולים (א) ובכך נראה לי שיצאנו ידי חובת הכל
Just as the text is presented according to the manuscripts, the division of the halachot is presented according to the majority of the manuscripts and fragments of manuscripts in my possession. Since Torah literature around the world quotes from the previously printed texts, I could not ignore them entirely, so that the reader can find what he is looking for without difficulty. Therefore I placed the section numbers from the manuscripts in brackets and the section numbers from the printed texts in parentheses, in an effort to oblige everyone. (Bohnen translation)
As such, there is not necessarily one precise answer to how many halachot there are; the number might vary based on edition/manuscript. Indeed, the number presented here is different from the number presented in the other answer which used a different (probably more faithful to the original) source.
Here is the breakdown by Sefer:
1-457
Total: 457 halachot
458-1154
Total: 697 halachot
1155-2852
Total: 1,698 halachot
2853-4037
Total: 1,185 halachot
4038-5254
Total: 1,217 halachot
5255-6062
Total: 808 halachot
6063-7656
Total: 1,594 halachot
7657-9188
Total: 1,532 halachot
9189-9697
Total: 508 halachot
9698-11505
Total: 1,808 halachot
11506-12446
Total: 941 halachot
12445-13430
Total: 985
13431-14219
Total: 789 halachot
14220-15024
Total: 805 halachot