Taylor Swift is penning a song about her split from Harry Styles.

The 23-year-old singer has been working on the tune since she and the One Direction star broke up in December, according to sources.

The Sun reports that Taylor is using a special “memory box” where she keeps mementoes from her ex-boyfriends to help with her creative process.

“Her main source of material for the songs she’s written about her string of other famous ex-boyfriends comes from rooting around in a trunk where she hoards keepsakes of their relationships,” a source told the newspaper.

“Photos of Harry are now in there, along with a chain he had made for her when they got together last year which matches his own favourite necklace - of a paper plane.”

Taylor has dated a string of high profile men including Joe Jonas and Jake Gyllenhaal.

Her two-month romance with Twilight star Taylor Lautner is said to have been the inspiration behind song Back to December, while a fling with John Mayer prompted her to write Dear John.

“Well, it’s not like it’s in fine print, but music is absolutely everything that I am and everything that I stand for,” she told Marie Claire last year about her tendency to write songs about her failed romances.

“It’s not my fault if someone gets into a relationship with me and then cheats and I write a song about it.”

She and Harry dated for several months before splitting over the holidays after getting into a huge argument while vacationing in British Virgin Islands.