gives the size of a file as a quantity.


  • FileSize returns a Quantity object.
  • FileSize uses units of bytes, kilobytes, megabytes, etc. to give a conveniently readable representation of the file size.
  • The file in FileSize can be specified by giving the path to the file as a string or a File object.
  • FileSize also works with cloud objects.


open allclose all

Basic Examples  (1)

Get the size of a file:

Scope  (2)

Get the file size for a File object:

Find the size of a CloudObject:

Generalizations & Extensions  (1)

FileSize uses SI prefix values for file size, where a megabyte is 106 bytes:

The resulting Quantity can be converted to other units using UnitConvert:

Applications  (1)

Use FileSize with FileSystemMap to inspect the size of various files in a directory:

Properties & Relations  (1)

FileSize gives the same number of bytes as FileByteCount:

Wolfram Research (2017), FileSize, Wolfram Language function,


Wolfram Research (2017), FileSize, Wolfram Language function,


Wolfram Language. 2017. "FileSize." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2017). FileSize. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_filesize, author="Wolfram Research", title="{FileSize}", year="2017", howpublished="\url{}", note=[Accessed: 18-June-2024 ]}


@online{reference.wolfram_2024_filesize, organization={Wolfram Research}, title={FileSize}, year={2017}, url={}, note=[Accessed: 18-June-2024 ]}