Mass density calculator