The song was written by Swift, along with Max Martin and Shellback, who helped her in writing and producing her previous hits "We Are Never Ever Getting Back Together" and "I Knew You Were Trouble".
Lagu "22" ditulis oleh Swift, bersama dengan Max Martin dan Shellback, yang membantu Swift menulis dan memproduksi lagu-lagu hits Swift sebelumnya, seperti "We Are Never Ever Getting Back Together" dan "I Knew You Were Trouble".