John here says that his information about God came from Jesus Christ; during his three years of public ministry the Saviour had instructed his apostles about the nature of God. Of course, Jesus is the trustworthiest authority that a person can have because he possesses infallible information about God.
So what did Jesus say about God? He taught many things about God and we can read what he said in the Gospels. It is not clear if John here is citing a specific statement that Jesus used or if he is giving a summary of what Jesus said. I suspect that the answer to the uncertainty is that both options are true. While the statement that ‘God is light’ is not recorded in the Gospels, it is the case that Jesus referred to himself as light. In any case, the phrase is a short, concise description of God.
The imagery of light and darkness is a frequent one in the Bible. For example, it is used to describe the two eternal destinations of heaven (light) and hell (darkness). It is also used to explain the difference between the Christian life (light) and the non-Christian life (darkness). Further, it contrasts the person of Christ (light) and the enemy Satan (darkness). And here it is used to describe God.
The imagery of light fits in with several of God’s attributes. For example, when the sun rises, light is present everywhere; or when we switch on a light in a room, the whole room is full of light. This is a reminder of God’s omnipresence, how he is everywhere simultaneously. Again, both the sun and a light in a room reveal everything that was unseen previously and this feature points to God’s knowledge or omniscience, that nothing is hidden from him.
When John says that God is light without darkness he is stating that God is marked by perfect purity. In other words, God is permanently holy, always without defect. This perfection includes his knowledge (he knows everything) and his actions, but it also extends to his character. This means that it is impossible for God to commit sin, to tolerate sin, to ignore sin. Sin is an offence to him and he is obligated to punish it.
Further, the illustration of light points to heat and warmth, and darkness points to cold. From this point of view, light reminds us that God loves strongly and deeply. There are no defects in his love, no fluctuations in its expression. Of course, his love includes a strong commitment to his own glory, which means that he will not tolerate even the minutest adverse reflection against it. This is why God is so determined to oppose sin – the reason is that he loves what is according to his character and he is against all that contradicts his character.
John is reminding his readers that their estimation of God will inevitably produce a certain kind of lifestyle. When a person fails to recognise or remember that God is pure, then their behaviour will tolerate sin; when a person fails to remember that God is full of love, then their behaviour will be marked by fear and dread of God rather than by a sense of intimacy with God.