Sticking solely with the internal witness of the Bible, we can narrow down the author to 1 of only 5 possible candidates.
John 13:25
He then lying on Jesus' breast saith unto him, Lord, who is it?
John 21:20
Then Peter, turning about, seeth the disciple whom Jesus loved following; which also leaned on his breast at supper, and said, Lord, which is he that betrayeth thee?
Whoever this disciple whom Jesus loved is, he was leaning on Jesus' breast at the last supper, and the Bible tells us that the only people present at the last supper were Jesus and his twelve disciples or apostles.
Matthew 26:20
Now when the even was come, he sat down with the twelve.
Mark 14:17
And in the evening he cometh with the twelve.
Luke 22:14
And when the hour was come, he sat down, and the twelve apostles with him.
There are those who insist that there were actually 15 people at the last supper, with the additional two attendees being those whom Jesus had sent to prepare for the meal. They'll go here in a failed attempt to prove their assertion:
Mark 14:13
And he sendeth forth two of his disciples, and saith unto them, Go ye into the city, and there shall meet you a man bearing a pitcher of water: follow him.
Mark 14:14
And wheresoever he shall go in, say ye to the goodman of the house, The Master saith, Where is the guestchamber, where I shall eat the passover with my disciples?
Mark 14:15
And he will shew you a large upper room furnished and prepared: there make ready for us.
Mark 14:16
And his disciples went forth, and came into the city, and found as he had said unto them: and they made ready the passover.
Mark 14:17
And in the evening he cometh with the twelve.
In other words, they'll try to convince you that these two disciples were separate from the twelve, but the Bible actually identifies these two disciples as Peter and John.
Luke 22:7
Then came the day of unleavened bread, when the passover must be killed.
Luke 22:8
And he sent Peter and John, saying, Go and prepare us the passover, that we may eat.
At this point, we've narrowed down the possible author who leaned upon Jesus' breast at the last supper to 12 candidates, but we can narrow that list down even further.
John 21:20
Then Peter, turning about, seeth the disciple whom Jesus loved following; which also leaned on his breast at supper, and said, Lord, which is he that betrayeth thee?
When Peter saw this disciple whom Jesus loved, there were only 8 people present at that time, and those eight people were Jesus and 7 of his disciples or apostles.
John 21:1
After these things Jesus shewed himself again to the disciples at the sea of Tiberias; and on this wise shewed he himself.
John 21:2
There were together Simon Peter, and Thomas called Didymus, and Nathanael of Cana in Galilee, and the sons of Zebedee, and two other of his disciples.
John 21:3
Simon Peter saith unto them, I go a fishing. They say unto him, We also go with thee. They went forth, and entered into a ship immediately; and that night they caught nothing.
John 21:4
But when the morning was now come, Jesus stood on the shore: but the disciples knew not that it was Jesus.
John 21:5
Then Jesus saith unto them, Children, have ye any meat? They answered him, No.
John 21:6
And he said unto them, Cast the net on the right side of the ship, and ye shall find. They cast therefore, and now they were not able to draw it for the multitude of fishes.
John 21:7
Therefore that disciple whom Jesus loved saith unto Peter, It is the Lord. Now when Simon Peter heard that it was the Lord, he girt his fisher's coat unto him, (for he was naked,) and did cast himself into the sea.
Out of these 7 possible candidates, which includes the sons of Zebedee or John and James, we can definitely discount Peter because the disciple whom Jesus loved is seen speaking to Peter. That brings our list of possible candidates for authorship down to 6. Depending upon when one believes the gospel in question was written, we can also rightly exclude James, John's brother, from the list of possible candidates because he was killed with the sword before the traditional timeframe of this gospel's writing.
Acts 12:1
Now about that time Herod the king stretched forth his hands to vex certain of the church.
Acts 12:2
And he killed James the brother of John with the sword.
That would leave only John, Thomas, Nathanael, and two other unnamed disciples as possible candidates for authorship.
There is external witness in the writings of the early church fathers which plainly identifies John as the author of the 4th gospel as well.