---

slug: /bit-value-type
---

# BIT-Value type

The `BIT` data type is used to store bit values.

Bit values are specified in the `b'value'` format, where `value` is a sequence of 0s and 1s. For example, `b'111'` represents the number 7, and `b'10000000'` represents the number 128.

The syntax is as follows:

```sql
BIT[(M)]
```

`M` specifies the number of bits for each value, with a range of \[1, 64\]. If `M` is omitted, the default is 1.

When inserting a value into a `BIT(M)` column, if the length of the inserted value is less than `M`, zeros are padded to the left. For example, inserting `b'101'` into a `BIT(6)` column results in `b'000101'`.