# calculate_content_size

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/utilities/pebblo/calculate_content_size)

Calculate the content size in bytes:
- Encode the string to bytes using a specific encoding (e.g., UTF-8)
- Get the length of the encoded bytes.

## Signature

```python
calculate_content_size(
    data: str,
) -> int
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `data` | `str` | Yes | Data string. |

## Returns

`int`

Size of string in bytes.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/utilities/pebblo.py#L402)