The writer of the fourth gospel is very clear about the source of his information — himself! The Apostle John testifies that he witnessed the events and is writing from personal knowledge, with the purpose of providing sufficient evidence that his readers would believe in Jesus:
And the Word became flesh, and dwelt among us, and we saw His glory, glory as of the only begotten from the Father, full of grace and truth. John 1:14 (NASB)
Therefore many other signs Jesus also performed in the presence of the disciples, which are not written in this book; but these have been written so that you may believe that Jesus is the Christ, the Son of God; and that believing you may have life in His name. John 20: 30-31 (NASB)
Again in his first letter, John says:
What was from the beginning, what we have heard, what we have seen with our eyes, what we have observed, and have touched with our hands, concerning the Word of Life [Jesus] — that life was revealed, and we have seen it and we testify and declare to you the eternal life that was with the Father and was revealed to us — what we have seen and heard we also declare to you, so that you may have fellowship along with us; and indeed our fellowship is with the Father and with His Son Jesus Christ. 1 John 1:1-3
John’s gospel has a very different tone from the first three and appears to have no dependence on them. He often gives another perspective to the events and includes some that are not included in the other gospels.