Melville's major source for the story was an advertisement for a new book, The Lawyer's Story, printed in both the Tribune and the Times on February 18, 1853. The book was published anonymously later that year but in fact was written by popular novelist James A. Maitland. This advertisement included the complete first chapter, which had the following opening sentence: "In the summer of 1843, having an extraordinary quantity of deeds to copy, I engaged, temporarily, an extra copying clerk, who interested me considerably, in consequence of his modest, quiet, gentlemanly demeanor, and his intense application to his duties". Melville biographer Hershel Parker points out that nothing else in the chapter besides this "remarkably evocative sentence" was "notable". Critic Andrew Knighton notes the debt of the story to an obscure work from 1846, Robert Grant White's Law and Laziness: or, Students at Law of Leisure. This source contains one scene and many characters—including an idle scrivener—that appear to have influenced Melville's narrative.
Melville may have written the story as an emotional response to the bad reviews garnered by Pierre, his preceding novel. Christopher Sten suggests that Melville found inspiration in Ralph Waldo Emerson's essays, particularly "The Transcendentalist" which shows parallels to "Bartleby".