We can use the ExFAT Specification to derive a formula that will tell us the best allocation size for a given usage.

Let's assume we are talking about a volume of size **V**, formatted with allocation size (cluster size) **C** and we intend to store files of average size **S** (all numbers are in bytes.)

All FAT filesystems, including ExFAT, store 2 copies of the FAT (file allocation table) each of which contains as many entries as there are clusters on the disk, with each entry taking up 4 bytes. This is the main source of Therefore the space dedicated (wasted) to the 2 copies of the FAT is approximately:

Additionally, each file will waste on average half a cluster, so we need to know how many files will fit on the disk. The number of files of average size S that will fit in the remaining space, once you allocate the 2 FAT copies, is approximately equal to:

Therefore, the total amount of wasted space or **filesystem overhead** is equal to:

The optimal cluster size corresponds to the minimum wasted space, therefore we compute the partial derivative of W with respect to C:

And solve the derivative for zero, keeping the positive answer:

Surprisingly (or not*) the optimal cluster size does not depend on the size of the volume, but only on the average size of the files.

If you can predict the average size of the files you will store on the device (just take an existing directory of similar data and divide its size by the number of files it contains), you can **take the square root of the average file size and multiply by 4** to get the optimal cluster size for an ExFAT drive.

(*) Thinking about it, the result makes sense. If you double a volume while keeping the cluster size constant, you are doubling both the space allocated to the FAT and that allocated to files. Therefore the ratio of wasted to used space remains unchanged.