What is the difference between dense and closed sets?

$[0,1]$ is a closed subset of $\mathbb R$ that is not dense. It contains all of its limit points, so it is closed. Some points in $\mathbb R$, for example $2$, are not limit points of this set, so the set is not dense.

$\mathbb Q$ is a dense subset of $\mathbb R$ that is not closed. It is not closed because it does not contain all of its limit points. For example $\sqrt 2$ is a limit point of this set because every open neighborhood of $\sqrt 2$ contains some rational numbers. It is dense because every point in $\mathbb R$ is one of its limit points.


I want to add one thing. The only closed, dense set in a topological space is the space itself!

So these two concepts are pretty far apart. So far that in most situations, they are mutually exclusive!