# Sort Files by Size

To properly use the "Sort by size" function in your media library and [document library](https://wordpress.org/plugins/filebird-document-library/) on the front-end, you will need to generate file size first.

### How to calculate file size <a href="#third-party-tools" id="third-party-tools"></a>

Go to FileBird Settings > Tools, click **Generate** attachment size.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FNAIgFSWcGjVlVOJMsiwm%2FScreenshot_24.png?alt=media&#x26;token=19ae6e1c-8752-47cf-8caf-c4f089f89a0a" alt=""><figcaption></figcaption></figure>

### How to sort files by file size <a href="#third-party-tools" id="third-party-tools"></a>

In Left Section of the Library, choose Sort > Sort Files > By Size. You can sort file by Size Ascending and Size Descending.

<figure><img src="https://3041978267-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyIWF9CNHLQhdztdjt8Uo%2Fuploads%2FTzZzgE8EU0pEWsKabY6l%2F2023-05-08_9-56-59.png?alt=media&#x26;token=0a9d3ddb-dda1-4fa5-9aae-ebe7cfeb9147" alt=""><figcaption></figcaption></figure>
