Gematria is a Greek word for the practice of assigning numerical values to letters. In Hebrew it has been used to interpret Jewish texts, particularly the Bible, by attempting to discover hidden meanings or connections between words and concepts.
One example of gematria is in Genesis 14:14 when Abram takes 318 men to rescue his relative. The gematria values of Abram’s servant Eliezer and of the Hebrew word for speaking are both 318. Perhaps there is more to this passage than just the 318 men. See
https://stljewishlight.org/arts-entertainment/understanding-hebrew-numerology-and-the-secrets-of-the-torah/#:~:text=One%20famous%20example%20of%20gematria,connects%20to%20the%20heavenly%20universe .
The table of 22 Hebrew letters and their gematria values is the following. I have omitted the five Hebrew letters that are formed differently when they appear as the last letter of a word, but their values are the same as the corresponding non last letter. Gematria does not use the dots and dashes vowel symbols that appear below the Hebrew letter.

Although gematria is not universally accepted by Jews and Jewish scholars, it is common in Jewish culture to make donations in multiples of $18: 18 is the gematria value of the Hebrew word “chai” (חי) which means “life”. ח
(chet equals 8) + י
(yod equals 10).
There is an R package gemmatria (two MM’s), but it is not currently available on CRAN due to encoding issues about non-ASCII characters. It is installable from GitHub using the devtools package with the following command: devtools::install_github(“benyamindsmith/gemmatria”, force=TRUE) . As an example of the package, the R code for the gematria value of yaakov, יעקב , is
library(gemmatria)
get_gemmatria(“יעקב”)
which gives 182. This is calculated as the sum (yod = 10) + (ayin = 70) + (qof = 100) + (bet = 2).
One online source that will accept a Hebrew word and calculate its gematria value is
https://www.torahcalc.com/tools/gematria .
Although the above website and gemmatria package are sufficient for most uses, I thought it would be instructive to build my own gematria calculator in R.
I began by creating a dataframe of the above table. I found the right-to-left nature of entering 27 Hebrew letters, surrounded by quotation marks and separated by commas, too cumbersome. Instead I used their Unicode hex equivalents, such as א
is u05D0 ; print(“\u05D0”) will print alef, א.
Then given a Hebrew word, I split the word into its individual characters, and I used the match command to look up and sum the gematria values. Note that the Hebrew word must not contain vowels, or else there will be no match.
I also added a little exploration of five Biblical descendants of Abraham and the number 26. 26 has a lot of significance in the Bible.
- 26 is the gematria value of the four letter unspeakable Hebrew name for G-d: Yod + He + Vav + He = 10 + 5 + 6 + 5 = 26.
- 26 is the number of generations from Adam to Moses.
- 26 is the number of generations from David to Jesus according to one geneaology (but interpretations differ).
- There are many examples of Biblical gematria values of 26.
26 also has some interesting mathematical properties such as it is the sum of a cube’s 6 faces, 12 edges, and 8 vertices, but I will leave such mathematical properties for another time.
For five of the Biblical descendants of Abraham:
- Gematria of Isaac יצחק is 208 is multiple of 26.
- Gematria of Jacob יעקב is 182 is multiple of 26.
- Gematria of Joseph יוסף is 156 is multiple of 26.
- Gematria of Ishmael ישמעאל is 451 is not multiple of 26.
- Gematria of Esau עשו is 376 is not multiple of 26.
I will leave an interpretation of the above to the reader.
There are many other examples of the use of gematria to help explain the Bible. Also, I have limited this to Standard Gematria; there are other forms.
Is gematria clever wordplay and coincidence? Or were the biblical writers trying to tell us something?
The R code is as follows:
# Define Hebrew letters, names, and gematria numbers df <- data.frame( hebrew = c("\u05D0", "\u05D1", "\u05D2", "\u05D3", "\u05D4", "\u05D5", "\u05D6", "\u05D7", "\u05D8", "\u05D9", "\u05DA", "\u05DB", "\u05DC", "\u05DD", "\u05DE", "\u05DF", "\u05E0", "\u05E1", "\u05E2", "\u05E3", "\u05E4", "\u05E5", "\u05E6", "\u05E7", "\u05E8", "\u05E9", "\u05EA"), name = c("Alef", "Bet", "Gimel", "Dalet", "He", "Vav", "Zayin", "Chet", "Tet", "Yod", "Final_Kaf", "Kaf", "Lamed", "Final_Mem", "Mem", "Final_Nun", "Nun", "Samech", "Ayin", "Final_Pe", "Pe", "Final_Tsadi", "Tsadi", "Qof", "Resh", "Shin", "Tav"), number = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 20, 30, 40, 40, 50, 50, 60, 70, 80, 80, 90, 90, 100, 200, 300, 400) ) # Define words; no vowels! yitzchak <- "יצחק" yaakov <- "יעקב" yosef <- "יוסף" ishmael <- "ישמעאל" esau <- "עשו" words <- c(yitzchak, yaakov, yosef, ishmael, esau) gematria <- function(word) { # Split word into characters v <- strsplit(word, split = "")[[1]] # Calculate Gematria of word using vectorized lookup gematria_value <- sum(df$number[match(v, df$hebrew)]) if (gematria_value %% 26 == 0) divisibility = "is multiple of 26" else divisibility = "is not multiple of 26" # Output result cat("Gematria of", word, "is", gematria_value, divisibility, "\n") } for (word in words) { gematria(word) }
End