A bar magnet is not a pure magnetic dipole, but we can calculate the dipole moment by comparing the magnetic fields of a bar magnet and a magnetic dipole at large distances where contributions from higher order moments become negligible.
The magnetic dipole field a distance $z$ from a dipole $m$ along the dipole axis is:
$$B=\frac{\mu_0 m}{2 \pi z^3}\tag{1}$$
For a cylindrical bar magnet, the magnetic field a distance $z$ from the centre along the symmetry axis is
$$B=\frac{B_r}{2}\left (\frac{z+L/2}{\sqrt{{R}^2+{(z+L/2)}^2}} -\frac{z-L/2}{\sqrt{R^2+(z-L/2)^2}}\right )\tag{2}$$
where $B_r$ is the remanence, and $L$ & $R$ are the length and radius of the magnet. (This is just a slight change of variables from the field given in the answer to "How strong is the magnetic field from a neodymium magnet?".)
At large distances from the magnet
$$\lim_{z\gg L,R} B=\frac{B_r R^2 L}{2z^3} \tag{3}$$
So the magnetic moment of a cylindrical bar magnet is
$$m=B_r\frac{AL}{\mu_0}\tag{4}$$
where $A=\pi R^2$ is the cross-sectional area of the bar magnet.
The remanence is not directly measurable, but can be calculated (using Eq. 2) from the magnetic field strength $B_{pole}$ on the magnet axis at the pole surface (i.e. at$z=L/2$):
$$B_r=2B_{pole}\sqrt{1+\left(\frac{R}{L}\right)^2} \tag{5}$$
which gives
$$m=2B_{pole}\frac{A}{\mu_0}\sqrt{L^2+R^2}\tag{6}$$
It is important to remember that although this may be the dipole moment of a bar magnet, a bar magnet has non-zero higher order moments whose contributions to the field fall off faster than the dipole $1/r^3$. The magnetic field of a bar magnet only matches a dipole field for distances much greater the dimensions of the magnet.