---
title: "Size Assertion"
description: "Configure the JMeter Size Assertion assertions: properties, defaults, and practical usage notes for building reliable load tests."
url: https://docs.jmeter.ai/components/size-assertion/
lastUpdated: 2026-10-01
source: docs.jmeter.ai
---

# Size Assertion

*Part of the **Assertions** category. Also documented in context in the [full Component Reference](/user-manual/component-reference/#size-assertion).*

![Size Assertion](/images/screenshots/size_assertion.png)

The Size Assertion tests that each response contains the right number of bytes in it.  You can specify that
the size be equal to, greater than, less than, or not equal to a given number of bytes.

> **Note**
> An empty response is treated as being 0 bytes rather than reported as an error.

| Name | Required | Description |
| --- | --- | --- |
| Name | No | Descriptive name for this element that is shown in the tree. |
| Apply to: | Yes | This is for use with samplers that can generate sub-samples,         e.g. HTTP Sampler with embedded resources, Mail Reader or samples generated by the Transaction Controller.          - `Main sample only` - assertion only applies to the main sample - `Sub-samples only` - assertion only applies to the sub-samples - `Main sample and sub-samples` - assertion applies to both. - `JMeter Variable Name to use` - assertion is to be applied to the contents of the named variable |
| Size in bytes | Yes | The number of bytes to use in testing the size of the response (or value of the JMeter variable). |
| Type of Comparison | Yes | Whether to test that the response is equal to, greater than, less than,         or not equal to, the number of bytes specified. |

## Related

- [Assertions & SLA Validation](/topics/jmeter-assertions-guide/)
- [Full Component Reference](/user-manual/component-reference/)
- [Functions and Variables](/user-manual/functions/)
