---
title: "Count ViewHelper <f:count>"
manual: "Fluid Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/fluid:typo3fluid-fluid-count"
source: "ViewHelpers/Fluid/Count.rst"
rendered: "2026-09-26T08:24:58+00:00"
---

# Count ViewHelper `<f:count>` {#typo3fluid-fluid-count}

> [!NOTE]
> This reference is part of the documentation of Fluid Standalone.
> If you are working with Fluid in TYPO3 CMS, please refer to
> [TYPO3's ViewHelper reference](https://docs.typo3.org/other/typo3/view-helper-reference/14.3/en-us/Global/Count.html) instead.

This ViewHelper counts elements of the specified array or countable object.

## Examples {#examples}

### Count array elements {#count-array-elements}

```php
<f:count subject="{0:1, 1:2, 2:3, 3:4}" />

```

Output:

```php
4

```

### inline notation {#inline-notation}

```php
{objects -> f:count()}

```

Output:

```php
10 (depending on the number of items in ``{objects}``)
```

Go to the source code of this ViewHelper: [CountViewHelper.php (GitHub)](https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/CountViewHelper.php).

**Arguments**

The following arguments are available for the count ViewHelper:

-   **subject**

    -   *Type:* array

    Countable subject, array or \\Countable
