Some argue that the Bible is contradictory concerning whether John the Baptist was Elijah. The argument is that Matthew 11:13-14 says that John the Baptist was Elijah, but John 1:19-21 says that John the Baptist was not Elijah. However, there is a reasonable explanation for this alleged contradiction in the Bible.
13 For all the Prophets and the Law prophesied until John, 14 and if you are willing to accept it, he is Elijah who is to come.
Matthew 11:13-14
19 And this is the testimony of John, when the Jews sent priests and Levites from Jerusalem to ask him, “Who are you?” 20 He confessed, and did not deny, but confessed, “I am not the Christ.” 21 And they asked him, “What then? Are you Elijah?” He said, “I am not.” “Are you the Prophet?” And he answered, “No.”
John 1:19-21
The intent of the questions in Matthew 11:13-14 and John 1:19-21 are different. In John 1:19-21, the question, “Are you Elijah?” is coupled with the question, “Are you the Prophet?” This seems to suggest that the questioner is asking John if he is the coming messiah, or the on around whom the promises centered. John’s answer to these questions was that he was not. In Matthew 11:13-14, Jesus is referring to John the Baptist as Elijah in the sense that John the Baptist was preparing the way for the messiah, Jesus, to come. The contrast between Matthew 11:13-14 and John 1:19-21 is that in Matthew, John the Baptist is described as being someone who would prepare the way for the messiah, while in John, John the Baptist is answering whether he is actually the messiah, or, at the very least, he is not being asked if he is merely someone who is going to prepare the way for the coming messiah.
To read more answers to alleged and apparent contradictions in the Bible, see “Contradictions” in the Bible Answered.
These books are also excellent resources: