@DocLength (Formula Language)

Returns the approximate size of a document in bytes.



Return value


Number. The size of the document.


This function works in any formula that runs in the context of one or more documents.

The number returned is only an approximation. The actual size of the document may differ for the following reasons:

  • The number accounts for user data only; it does not take into account per document or per field constants such as static text or formulas.
  • The database allocates storage in 64-byte increments; a document may not use all of the 64 bytes allotted to it.

Documents that are open typically use more storage than documents that are closed. The value returned for @DocLength may vary depending on whether it is running in an open document or a closed document; for example, a document selected at the view level.


This example returns 1808 if that is the approximate number of bytes in the document (one-page document, no enhanced text).