`` If I Were a Boy '' is a song recorded by American singer Beyoncé for her third studio album , `` I Am ... Sasha Fierce '' ( 2008 ) . It was written by BC Jean and Toby Gad and Deejaycyfer , who also handled its production alongside Knowles .
`` If I Were a Boy '' is a song by American R&B singer Beyoncé Knowles , written by Toby Gad , BC Jean and Beyoncé Knowles for her third solo album , `` I Am ... Sasha Fierce '' ( 2008 ) .