He was known for co-creating the Fox series Rel and as a writer on TV comedies including Broad City, as well as for his routines as a stand-up.
Barnett was reportedly on holiday in Mexico when he died, but the cause of death is not yet known.
"We are deeply saddened by the passing of our friend and client Kevin Barnett," his talent agency UTA wrote on Twitter.
"He was an incredible talent and a wonderful person. Our thoughts are with his family and friends."
Barnett's last Instagram post before he died showed him in Mexico. The comments section has since been flooded with tributes from fans.