What is the symbolic meaning of butterfly?

It could be a symbol of multiple things depending on the context, a writer pointing out a butterfly could show purity or beauty, whereas a butterfly coming out of its cocoon can symbolize either the evolution of a character or a character "coming out of his or her shell". Also a dead butterfly can represent the loss of beauty or purity in the world.