---
schema_version: "1"
id: 7a3893a9d2612ac240d31ca656e36cf9f0ec485243283f2f8ed6bbf826b21f87
title: Empty()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/utilities/mc-ampscript-reference-utilities-empty.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-empty.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d17df15f490f7973056786ce151bdfaff63ec0b05c93daf4f063741d82b6e564
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# Empty()

Tests to see if a variable has a value. If the variable has a value, the function returns `false`. If the variable is an empty string or null, the function returns `true`.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

This function became available in Marketing Cloud Next during the Summer ’26 release (API version 67.0).

In Marketing Cloud Engagement, the `variable` parameter can be a variable, a string literal, or a number. In Marketing Cloud Next, the `variable` parameter must refer to a variable. If it isn’t a variable, the function returns an error.

## Syntax

```
Empty(variable)
```

The `Empty()` function has this parameter:

- `variable` (string): Required. The variable that you want to test to see if it’s empty.

## Usage

You can combine the `Empty()` function combined with If statements or the [Iif()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-iif.md) function to test for empty or null values, and to output the values of variables that aren't empty. This example declares three variables, assigns a text string to one, an empty string to another, and leaves the third unset.

```
%%[
  Var @empty_var, @null_var, @non_empty_var
  Set @non_empty_var = "Hello, world!"
  Set @empty_var = ""
]%%

<p>@empty_var: %%= Iif(not Empty(@empty_var), @empty_var, "Empty or null") =%%</p>
<p>@null_var: %%= Iif(not Empty(@null_var), @null_var, "Empty or null") =%%</p>
<p>@non_empty_var: %%= Iif(not Empty(@non_empty_var), @non_empty_var, "Empty or null") =%%</p>
```

The example produces this output.

```
@empty_var: Empty or null

@null_var: Empty or null

@non_empty_var: Hello, world!
```
