What is the difference between top soil and compost?

Topsoil is as the name indicates, the top layer of soil and is composed of both inorganic (sand, clay, and/or other granular matter) and organic matter (humus). Compost is composed of strictly organic matter in a partially broken down state.