When compiling technical specifications, compliance reports, e-discovery exhibits, or corporate publishing templates in Microsoft Word, document metadata—such as page counts, revision numbers, and file sizes—is frequently required on cover pages and audit footers. While word counts and page numbers reflect internal document volume, communicating the physical on-disk file size is critical for users downloading documentation over bandwidth-constrained networks or submitting filings with strict email attachment limits. Manually typing file sizes into document prose requires constant checking in Windows File Explorer or macOS Finder. Microsoft Word automates this metadata tracking with the FILESIZE field code.
How the FILESIZE Field Code Operates
The FILESIZE field code reads the physical file size of the active document as recorded on the storage filesystem during the most recent save operation. Whenever you save changes to the document and refresh the fields, Word automatically updates the displayed value.
The standard syntax for the field is:
{ FILESIZE [Switches] }
By default, if no unit switches are provided, the FILESIZE field outputs the raw file size in bytes (for example, 1048576). To format this raw integer into human-readable units—such as kilobytes (KB) or megabytes (MB)—Word provides specialized switches.
FILESIZE Field Switches for Unit Conversion
The FILESIZE field supports specific unit-scaling switches:
| Switch | Output Format | Example Construction |
|---|---|---|
\k |
Displays file size rounded to the nearest whole Kilobyte (KB). | { FILESIZE \k } |
\m |
Displays file size rounded to the nearest whole Megabyte (MB). | { FILESIZE \m } |
| (None) | Displays file size in raw bytes without scaling. | { FILESIZE } |
For example, if your document file is 2,450,112 bytes on disk:
{ FILESIZE }renders as2450112.{ FILESIZE \k }renders as2393.{ FILESIZE \m }renders as2.
Inserting the FILESIZE Field Manually
To insert a dynamic file size indicator into your document header, footer, or metadata summary block:
- Place your cursor where the file size should appear (for example:
Total File Size:). - Press Ctrl + F9 (or Command + F9 on macOS) to generate raw field brackets:
{ }. - Inside the brackets, type
FILESIZEfollowed by your desired switch:{ FILESIZE \k } - Outside the field brackets, append the unit label:
KB.{ FILESIZE \k } KB - Press F9 to evaluate and render the field.
Word collapses the brackets and displays the evaluated number followed by your label: “2393 KB”.
Applying Custom Number Formatting with the \# Switch
When displaying raw bytes or large kilobyte counts, adding comma thousand-separators improves readability. You can combine unit switches with the numeric picture formatting switch (\#):
Example: Adding Digit Grouping Separators to Byte Counts
{ FILESIZE \# "#,##0" } bytes
If the file is 1,524,300 bytes, this renders neatly as: “1,524,300 bytes” rather than an unformatted continuous number.
Example: Formatting Kilobytes with Grouping
{ FILESIZE \k \# "#,##0" } KB
This renders as: “1,489 KB”.
Updating and Refreshing FILESIZE Values
Because the FILESIZE field derives its value from the physical disk file, it requires two conditions to accurately calculate:
- The Document Must Be Saved: An unsaved new document (e.g., Document1) has no physical file representation on disk, causing the field to evaluate to
0. Always save the document (Ctrl + S) before evaluating. - Field Refresh: Word evaluates fields during specific events, such as document opening, printing, or manual recalculation.
To refresh the file size immediately after saving changes:
- Select the field (or press Ctrl + A to select the entire document) and press F9.
- To toggle between the field code
{ FILESIZE \k }and the rendered value, press Alt + F9 (or Option + F9 on macOS).
Automating Field Updates on Document Print and Export
To guarantee that exported PDF copies and printed distributions always reflect the exact final file size without manual F9 updates:
- Go to File > Options.
- Select Display in the left navigation sidebar.
- Under Printing options, check the box labelled Update fields before printing.
- Click OK.
Word will automatically save and recalculate the FILESIZE field during every export or print operation, guaranteeing accurate publication metadata.