---
title: bin function
description: Learn the syntax of the bin function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/bin
---

# `bin` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns the binary representation of `expr`.

## Syntax

```
bin(expr)
```

## Arguments

* `expr`: A BIGINT expression.

## Returns

A STRING.

## Examples

```sql
> SELECT bin(13);
 1101
> SELECT bin(-13);
1111111111111111111111111111111111111111111111111111111111110011
> SELECT bin(13.3);
 1101
```

## Related functions
