'The A Team' hitmaker thinks the One Direction heartthrob, who owns two houses of his own, stays with him because he wouldn't want to be alone in either of his big homes.
Harry, 19, often stays with his celebrity friends, and Ed thinks it's because he wants company when he's not with his bandmates.
Talking to US radio station 95.5 WPLJ, he said: ''He lives just at his mates' houses. It's cool cos obviously he gets to see his friends every day and you wouldn't want to be in a big house on your own.''
The 'Little Things' pop star has two luxury homes of his own, but he still insisted on staying with Ed, 21, even if the singer suggested otherwise.
He added: ''The strangest thing about Harry is he lived at my flat for a while, but he had a house, he had two houses... this was like a couple of months ago.
''He had two very posh houses in London and he'd just come and stay.''