THIS MIGHT SURPRISE YOU
The answer
Ezra. In his Theological-Political Treatise (1670), Spinoza proposed that Ezra put the five books together. The Bible calls Ezra "a scribe skilled in the law of Moses" (Ezra 7:6). Spinoza thought Ezra kept some laws that went back to Moses himself. The older answer, that Joshua added the last verses, had been the usual view for centuries.
Why it’s interesting
Modern scholars generally avoid naming one editor. But they tend to agree with Spinoza about the time: the age of Ezra is when the five books reached their present form.
Scholarly consensus
Learn the Bible.
Not just the stories, but the history, authorship, and scholarship behind it.