A method for calculating a hardness value of a material, the method comprising: receiving a set of raw data representing a three-dimensional, 3D, topography of an indent created on a surface of the material measured by an instrument; generating a complete data set, CDS, from the set of raw data by processing the set of raw data based on measuring quality of the instrument; converting the CDS to a two-dimensional, 2D, data set, CDS_2D, in an X-Y coordinate plane representing a 2D picture having a circle in the middle representing the indent; dividing the CDS into two data sets by using the X-Y coordinate of the circle in CDS_2D, a first data set, CDS1, comprising data inside the circle, a second data set, CDS2, comprising the remaining data outside the circle; calculating a tilting factor based on the CDS2 in the X-Y coordinate plane; generating a levelled complete data set, CDS_L, by adjusting the CDS with the tilting factor and regenerating from CDS_L, a first levelled data set, CDS1_L, comprising data inside the circle, a second levelled data set, CDS2_L, comprising the remaining data outside the circle; calculating a mean value, ZL, in Z-direction from the CDS2_L, wherein the ZL represents an average height of the surface of the material; defining a zero plane, ZP, representing an original surface of the material by setting ZL value as a zero level in the CDS_L; calculating a roughness value, Ra1, of the material surface from CDS2_L; generating a complete data set of indent, CDSI, from the CDS1_L by finding all data in the CDS1_L below the zero plane, minus the Ra1; selecting a sphere shape by fitting the shape of the sphere to all data values in CDSI using the least squares method, wherein a diameter of the sphere is referred to as Sphere_1 and an origin of the sphere on the X-Y plane is referred to as Origin of Sphere_1; adjusting the CDS_L such that all data in the CDS_L are centred on the Origin of Sphere_1; calculating a second diameter, Diameter_2, of an intersection of the zero plane, ZP, and the sphere; calculating a first Hardness Brinell value, HB_1, based on the second diameter Diameter_2. receiving a set of raw data representing a three-dimensional, 3D, topography of an indent created on a surface of the material measured by an instrument; generating a complete data set, CDS, from the set of raw data by processing the set of raw data based on measuring quality of the instrument; converting the CDS to a two-dimensional, 2D, data set, CDS_2D, in an X-Y coordinate plane representing a 2D picture having a circle in the middle representing the indent; dividing the CDS into two data sets by using the X-Y coordinate of the circle in CDS_2D, a first data set, CDS1, comprising data inside the circle, a second data set, CDS2, comprising the remaining data outside the circle; calculating a tilting factor based on the CDS2 in the X-Y coordinate plane; generating a levelled complete data set, CDS_L, by adjusting the CDS with the tilting factor and regenerating from CDS_L, a first levelled data set, CDS1_L, comprising data inside the circle, a second levelled data set, CDS2_L, comprising the remaining data outside the circle; calculating a mean value, ZL, in Z-direction from the CDS2_L, wherein the ZL represents an average height of the surface of the material; defining a zero plane, ZP, representing an original surface of the material by setting ZL value as a zero level in the CDS_L; calculating a roughness value, Ra1, of the material surface from CDS2_L; generating a complete data set of indent, CDSI, from the CDS1_L by finding all data in the CDS1_L below the zero plane, minus the Ra1; selecting a sphere shape by fitting the shape of the sphere to all data values in CDSI using the least squares method, wherein a diameter of the sphere is referred to as Sphere_1 and an origin of the sphere on the X-Y plane is referred to as Origin of Sphere_1; adjusting the CDS_L such that all data in the CDS_L are centred on the Origin of Sphere_1; calculating a second diameter, Diameter_2, of an intersection of the zero plane, ZP, and the sphere; calculating a first Hardness Brinell value, HB_1, based on the second diameter Diameter_2.