> For the complete documentation index, see [llms.txt](https://docs.internetobject.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.internetobject.org/structure-and-syntax/values/booleans.md).

# Booleans

A **boolean** is a logical value, either true or false. Booleans are scalar values used for flags, binary states, and conditions.

Each value has a compact and a verbose form, letting you trade brevity for explicitness.

## Syntax

```ebnf
boolean        = compactBoolean | verboseBoolean
compactBoolean = "T" | "F"
verboseBoolean = "true" | "false"
```

## Structural elements

| Token   | Name          | Description               |
| ------- | ------------- | ------------------------- |
| `T`     | Compact true  | `true` in compact form    |
| `F`     | Compact false | `false` in compact form   |
| `true`  | Verbose true  | the verbose true keyword  |
| `false` | Verbose false | the verbose false keyword |

## Valid forms

The compact and verbose forms are equivalent; the compact form is recommended for terse data.

```ruby
---
T, F, true, false
```

## Not a boolean

Boolean keywords are **case-sensitive and spelled exactly**. Any other token is not an error — it is parsed as a different value type, so it is *not* a boolean:

```ruby
t                    # open string "t", not true
TRUE                 # open string "TRUE", not true
True                 # open string "True", not true
1                    # the number 1, not true
0                    # the number 0, not false
```

> Under a `bool` schema, a non-boolean value fails validation with `not-a-bool`. Without a schema, the values above are simply kept as their parsed type (string or number).

## See Also

* [Value Representations](/structure-and-syntax/values.md) — all value types
* [Nulls](/structure-and-syntax/values/null.md) — the absence of a value
* [Bool](/schema-definition-language/data-types/bool.md) — the boolean schema type


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.internetobject.org/structure-and-syntax/values/booleans.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
