Swift, who has a tendency to write songs about her former boyfriends, is rumoured to have written Out of the Woods and Style about the former One Directioner.
"I don't know if they are about me or not," Styles said. "But the issue is she's so good, they're bloody everywhere.
"I write from my experiences; everyone does that. I'm lucky if everything [we went through] helped create those songs. That's what hits your heart. That's the stuff that's hardest to say, and it's the stuff I talk least about. That's the part that's about the two people. I'm never going to tell anybody everything."
Harry went on to thank Swift for "celebrating" their time together by writing about their romance as it proved he meant something to her.
Asked if there was anything he wanted to say to the 27-year-old singer now, he said: "Certain things don't work out. There's a lot of things that can be right, and it's still wrong. In writing songs about stuff like that, I like tipping a hat to the time together.
"You're celebrating the fact it was powerful and made you feel something, rather than 'this didn't work out, and that's bad," he said. "And if you run into that person, maybe it's awkward, maybe you have to get drunk ... but you shared something. Meeting someone new, sharing those experiences, it's the best shit ever. So thank you."
Swift was reportedly heartbroken when the pair split and may have been why Gigi Hadid, who is best friends with Swift and another of Styles' exes, Kendall Jenner, seemed to snub him at the American Music Awards in 2015.
Meanwhile, One Direction fans were in a frenzy this week after Styles released Sign of the Times, the first single from his upcoming album.
Styles hinted that most of his first solo album was about another relationship - potentially his romance with Kylie Jenner.
"She's a huge part of the album," said Styles. "Sometimes you want to tip the hat, and sometimes you just want to give them the whole cap ... and hope they know it's just for them."