<?php echo number_format($_FILES['photo']['size']/1024/1024,4,'.',''); ?> Here is the format to view the file size. At the beginning file size will shown as byte when we will write the code as follows, echo number_format($_FILES['photo']['size']); We know 1024 byte = 1kb. So if we want to represent the size as kilobyte format we have to divide the size by 1024 so the code will be like that, echo number_format($_FILES['photo']['size']/1024); But if we want to show the file size as megabyte format we have to divide this again by 1024 cause we know 1024kb = 1mb. And the coding will be like that, echo number_format($_FILES['photo']['size']/1024/1024); There is a problem if you divide 100/1024 that means if you divide 100kb by 1024kb to convert megabyte you will get out put 0. Cause after point values are not printing. So what is the solution to get the values after point. Here is your code given...