Most Revd Justin Welby told pupils at a school in Highgate that he had "a lot of gay friends" but was still against same sex unions.
He said he was "listening very, very closely to try to discern what the spirit of God is telling us", according to a report in the Daily Mirror.
But he urged that it would be wrong to "demonise and dismiss and hate each other".
In response to a student's question at St Albans Academy in London, the archbishop said: "I see my own selfishness and weakness and think who am I judge them for their sins, if they have sins.
"We shouldn't demonise and dismiss and hate each other as that is so dangerous.
"Marriage is between one man and one woman for life and sexual activity should be confined to marriage, that's in the Church of England's laws.
"I'm equally aware I have a lot of gay friends and I know gay clergy and they are doing incredible work."
Gay marriage was legalised in England and Wales in March last year and in December in Scotland. It is still illegal in Northern Ireland.
The Republic of Ireland will hold a referendum on the issue in May.