> 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/schema-definition-language/data-types/binary.md).

# Binary

The **`binary`** type validates a sequence of bytes. In data, binary is written as a base64 literal with a `b` prefix: `b'SGVsbG8='`. (Base64 is the *encoding*; `binary` is the *type*.)

> For the literal value syntax, see [Binary values](/structure-and-syntax/values/binary.md).

## TypeDef

A `binary` MemberDef accepts the options below.

| Option     | Type            | Description                                                  |
| ---------- | --------------- | ------------------------------------------------------------ |
| `type`     | string          | The type name `binary`. First positional value.              |
| `default`  | binary          | Value used when the member is omitted.                       |
| `choices`  | array of binary | Restricts the value to a fixed set.                          |
| `len`      | int ≥ 0         | Exact length in bytes.                                       |
| `minLen`   | int ≥ 0         | Minimum length in bytes.                                     |
| `maxLen`   | int ≥ 0         | Maximum length in bytes.                                     |
| `optional` | bool            | If `true`, the member may be omitted. Shorthand: `?` suffix. |
| `null`     | bool            | If `true`, the member may be `null`. Shorthand: `*` suffix.  |

## Example

```ruby
avatar: { binary, maxLen: 65536 }
---
~ b'SGVsbG8='
```

## Implementation status (beta)

> **Binary is under development.** The `binary` schema type is being added to the reference implementation (it is not yet registered), and the `b'…'` value literal is not yet accepted by the parser. The design above is the agreed target; examples are not yet executable and are excluded from the example verifier.

## See Also

* [Binary values](/structure-and-syntax/values/binary.md)
* [TypeDef](/schema-definition-language/advanced-schema-concepts/typedef.md) · [MemberDef](/schema-definition-language/advanced-schema-concepts/memberdef.md)


---

# 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:

```
GET https://docs.internetobject.org/schema-definition-language/data-types/binary.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.
