Some argue that the Bible is contradictory concerning who killed Goliath. The argument is that 1 Samuel 17:50 says that David killed Goliath, yet 2 Samuel 21:19 says that Elhanan killed Goliath. However, there is a reasonable explanation that resolves this alleged contradiction in the Bible.
So David prevailed over the Philistine with a sling and with a stone, and struck the Philistine and killed him. There was no sword in the hand of David.1 Samuel 17:50
And there was again war with the Philistines at Gob, and Elhanan the son of Jaare-oregim, the Bethlehemite, struck down Goliath the Gittite, the shaft of whose spear was like a weaver’s beam.2 Samuel 21:19
1 Chronicles 20:5 says that Elhanan killed Goliath’s brother:
And there was again war with the Philistines, and Elhanan the son of Jair struck down Lahmi the brother of Goliath the Gittite, the shaft of whose spear was like a weaver’s beam.1 Chronicles 20:5
Gleason Archer suggests this concerning 2 Samuel 21:19 containing a copyist error:
1. The sign of the direct object, which in Chronicles comes just before “Lahmi,” was ‘-t; the copyist mistook it for b-t or b-y-t (“Beth”) and thus got Bet hal-Lahmi (“the Bethlehemite”) out of it.2. He misread the word for “brother” (‘-h) as the sign of the direct object (‘-t) right before g-l-y-t (“Goliath”). Thus he made “Goliath” the object of “killed” (wayyak), instead of the “brother” of Goliath (as the Chronicles passage does).3. The copyist misplaced the word for “weavers” (‘-r-g-ym) so as to put it right after “Elhanan” as his patronymic (ben Y-‘-r-y’-r–g-ym, or ben ya ‘arey ‘ore -gim — “the son of the forests of weavers” — a most unlikely name for anyone’s father!). In Chronicles the ‘ore grim (“weavers”) comes right after menor (“a beam of “) — thus making perfectly good sense.Archer, Gleason. ”Encyclopedia of Bible Difficulties”, 179.
So, the solution to this alleged contradiction is that 1 Chronicles 20:5 preserves what the original text says, while 2 Samuel 21:19 contains a copyist error.
There are some foundational principles that apply to all alleged and apparent contradictions in the Bible. To read more, see Bible Difficulties: Foundational Principles.
To read more answers to alleged and apparent contradictions in the Bible, see “Contradictions” in the Bible Answered.
These books are also excellent resources: