Formal and informal language serve different purposes. The tone, the choice of words and the way the words are put together vary between the two styles.
Formal language is less personal than informal language. It is used when writing for professional or academic purposes like university assignments.
Informal language is more casual and spontaneous. It is used when communicating with friends or family either in writing or in conversation. The tone of informal language is more personal than formal language.