ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAM
1
This chart calculates the filesystem layout and capacity of an exFAT formatted drive.
2
Assumes GPT (GUID Partition Table)
3
Assumes single partition spanning the entire volume (multiple partitions merely have to account for the difference in partitioning overhead vs filesystem overhead and correctly follow partition boundaries when making calculations).
4
The most convenient unit of data to work with is a "sector". Units are noted in [square brackets]. Probably all flash drives have a logical sector size of 512 bytes. Remember what your high school physics teacher told you about keeping your units straight. It's important!
5
N.B. Flash storage devices, SSDs including, will often have larger sectors (called pages) physically, but will happily lie about it to the OS. Most spinning rust drives will instead correctly report 4K physical sectors, but will emulate 512 bytes to the OS for the benefit of backwards compatibility.
6
exFAT specification: https://learn.microsoft.com/en-us/windows/win32/fileio/exfat-specification
7
8
Hardware (sort of)
9
512
sector size [bytes]
10
30851071
Total drive sectors
device and formatter dependent parameters
11
[KiB][sectors][clusters][bytes][sectors][KiB][clusters][KiB][KiB][bytes][sectors][clusters][clusters][KiB][sectors][sectors][sectors][sectors][sectors][sectors][KiB]
12
34First use LBA2ⁿcluster sizecluster sizedatadatawasted spacewasted spacemetadatametadatatotal "wasted" spacebitmapbitmapbitmapUp-case tableoffset overheadfrac clusters
available for cluster heap
cluster heap offset [sectors]
min cluster heap offset
FAT offsetFAT lenmin FAT len
FAT len factors
ceil to even values
cluster heap offset dec2bin
Number of files above which a lower cluster size becomes more efficient.
Avg wasted space per file
13
30851038Last use LBA-10.513060527815669902336007486374312559938256607472747212121856306052783060527824371224305620482410082391042*4+3+502115063150642*3+7+269188447260161110111000000000000.25
14
0121536305515731768320001884188463324192038237511876661440153630553072611012288012255220481205041200242*3+3+502115063150642*3+7+269188447260160111100000000000002491000.5
15
2048First LBA
The only values we care about.
124769637515762176000214759503269596204718794703317447696375.5307855026348862300204860252601282*2+3+502115063150642*3+7+26918844726016001111100000000000612581
16
30851038Last LBA24838520271577790259263122488168754815049411182163843852027.75308162223276832176204830128300942*4+7+269188318842*2+3+1574726016001000000000000000158202
17
381619269091578523852814733264948724086447130192161926909.875308305581843217120204815072150542*5+3+1574714722*3+59601600010010000000000036944
18
These values are located in the boot sector.
41632963710157894246403015111765311120464236815120963710.9375308387501024096002048755275292*7+5959602*2+3+51600001010000000000010448
19
2048
partition offset [sectors]
532644819191579152179230155160324760240118213072481919.468830842846614458242048377637652*6+5959602*2+3+51600000110000000000025816
20
4096FAT offset664128240975157925376009447425623513012259112048240975.734430844894409639682048192018832*7+3+515160000010000000000005632
21
4096712825612048715792472064222111451226711506130112048120487.8672308448944096307220481024942-1064
22
6144
partitioning overhead [sectors]
8256512602431579234099247823941024331175311511204860243.9335930844894409625602048512471-10128
23
9512102430121157920788489904954204845913766811204830121.9668308448944096307220481024236-10256
24
30844894
sectors available for cluster heap
10102420481506015791554560201410074409671511883411204815060.9834308448944096409620482048118-10512
25
112048409675291578945740820141007481921329594221140967529.49169930840798819281924096409659-121024
26
1240968192376315783165952611030554163842763147111181923763.745853083260616384163848192819230-142048
27
5836
Up-case table [bytes]
1381921638418801577058304014302715143276856303235111163841880.872925308162223276832768163841638415-144096
28
12
Up-case table [sectors]
1416384327689391575380582414302715146553610545511811132768939.436462430783454655366553632768327688-128192
29
15327686553646815703474176470702353541310722201435911165536468.71823123071791813107213107265536655364
30
31
32
64
Optimal cluster size for maximizing capacity.
Goes x2, but then every once in a while fits just a little bit shy of x2
33
30851038
16 gig flash stick
May involve bitwise ops.
34
39070228402TB drive
May be tied to cl heap offset.
35
241696759128-ish gig
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100