# Truthy and falsy

When a non-boolean[ data type](/impulse-user-manual/content-manipulators-motators/liquid-field/basics/types.md) is used in a boolean context (such as a conditional tag), Liquid decides whether to evaluate it as `true` or `false`. Data types that return `true` by default are called **truthy**. Data types that return false by default are called **falsy**.

### Truthy <a href="#truthy" id="truthy"></a>

All values in Liquid are truthy except `nil` and `false`.

In the example below, the text “Tobi” is not a boolean, but it is truthy in a conditional:

```
{% assign name = "Tobi" %}

{% if name %}
  This text will always appear since "name" is defined.
{% endif %}
```

[Strings](https://shopify.github.io/liquid/basics/types/#string), even when empty, are truthy. The example below will create empty HTML tags if `category` exists but is empty:

Input

```
{% if category %}
  <h1>{{ category }}</h1>
{% endif %}
```

Output

```
  <h1></h1>
```

### Falsy <a href="#falsy" id="falsy"></a>

The only values that are falsy in Liquid are `nil` and `false`.

### Summary <a href="#summary" id="summary"></a>

The table below summarizes what is truthy or falsy in Liquid.

|              | truthy | falsy |
| ------------ | ------ | ----- |
| true         | •      |       |
| false        |        | •     |
| nil          |        | •     |
| string       | •      |       |
| empty string | •      |       |
| 0            | •      |       |
| integer      | •      |       |
| float        | •      |       |
| array        | •      |       |
| empty array  | •      |       |
| page         | •      |       |
| EmptyDrop    | •      |       |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/liquid-field/basics/truthy-and-falsy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
