An upper mean here is a subadditive functional $\overline M$ defined on bounded functions on a commutative group which has, beside some natural requirements, the property we call restricted additivity: if $g(x)= f(x)+f(x+t)$, then $\overline{M} (g)= 2 \overline{M} (f)$. This tries to grasp that it should not depend on local properties. This naturally induces a lower mean, and when they coincide it is the mean. Restriction to 0--1 valued functions (sets) is a density.
We answer the following questions:
Given a functional defined on a subset of all functions, when is it a mean?
Given a functional, which is a mean, how do we find the upper mean it came from? Is it unique?
Given a function $f$, what are the possible values of $\overline M(f)$, for upper means $\overline M$?
In particular, we find the extremal means and give several expressions for it. We propose the names ``lowest and uppermost mean'' for them to replace the not really justified names ``lower and upper Banach mean and density''.
We also consider analogous questions for densities, with partial answers only.