---
title: "Bin numbers into ranges in Strata | Oplema"
description: "Group numbers into ranges with Bin in Strata: equal count, equal width, standard deviation or your own cut points, with optional labels for each range."
url: "https://oplema.com/docs/strata/prep/bin"
updated: "2026-11-04"
---

# Bin

Bin groups the numbers in a column into ranges and gives each row a bin number, starting at 1. Choose equal counts, equal widths, standard deviations or your own cut points. Replace the column or add a new one. Every method except Equal width can also label each range.

**Learn this in context:** [More data tools: when you'd use each one](https://oplema.com/learn/table-to-dashboard/more-data-tools) (Build and publish a dashboard)

## Group prices into three bands

Manual Input holds six products. Bin splits price into three bins with equal numbers of rows, keeps the original column and adds a label.

Result
| price | product | price\_bin | price\_bin\_label |
| --- | --- | --- | --- |
| 1 | Pen | 1 | Q1 of 3 |
| 5 | Mug | 1 | Q1 of 3 |
| 9 | Lamp | 2 | Q2 of 3 |
| 12 | Book | 2 | Q2 of 3 |
| 20 | Bag | 3 | Q3 of 3 |
| 33 | Chair | 3 | Q3 of 3 |

1. Look at the preview. Pen and Mug are in bin 1, Lamp and Book in bin 2, Bag and Chair in bin 3. The new columns are `price_bin` and `price_bin_label`.
2. Change Bins to `2`. Each bin now holds three products, and the labels read `Q1 of 2` and `Q2 of 2`.
3. Uncheck Separate Columns. The bin number now replaces the value in `price`.

## When to use

Use Bin to turn exact numbers into bands, such as low, medium and high prices or age groups. To rescale numbers without grouping them, use Scale. To convert text categories, use Encode.

To rescale numbers without grouping them, use [Scale](https://oplema.com/docs/strata/prep/scale).

To convert text categories to numbers, use [Encode](https://oplema.com/docs/strata/prep/encode).

## Inputs and outputs

### Inputs

1 port

**In Required**

Accepts: Tables, Geospatial data.

Accepts one connection on this port.

### Outputs

1 port

**Out**

## Configure the block

**Columns**

The binning method for each numeric column. None leaves a column unchanged. Equal count puts roughly the same number of rows in each bin. Equal width splits the value range into equal intervals. Standard deviation groups values into six bands by their distance from the mean. Manual cuts at the break points you enter.

**Equal count all numeric**

Sets every numeric column to Equal count.

**Equal width all numeric**

Sets every numeric column to Equal width.

**Std dev all numeric**

Sets every numeric column to Standard deviation.

**Clear all**

Sets every column back to None.

**Group By**

Optional categorical columns that bin each group independently, e.g. revenue deciles within each country. Leave empty to bin over all rows together. Manual breaks are absolute and ignore grouping.

**Bins**

Number of bins for equal-count and equal-width methods. Standard deviation always uses six bands and ignores this setting. Bins number from 1 upward and nulls stay null. Equal count, equal width and standard deviation compute their cut points per group; manual breaks are absolute and ignore Group By.

Default: `4`

**Breaks**

Comma-separated cut points for manual binning, in increasing order. N breaks produce N + 1 bins.

**Separate Columns**

Write bin numbers to new <column>\_bin columns instead of replacing the source.

Default: `true`

**Add Label**

Append a <column>\_bin\_label text column describing each bin's range. Equal width adds no label.

Default: `false`

## Bin FAQs

**Why does Standard deviation ignore Bins?**

Standard deviation always uses six fixed bands around the mean: below -2, -2 to -1, -1 to 0, 0 to 1, 1 to 2 and above 2 standard deviations. Bins applies only to Equal count and Equal width.

**Which methods can add a label?**

Add Label works with Equal count, Standard deviation and Manual. Equal width adds no label column.

**What happens to missing values?**

Nulls stay null, whichever method you choose. The row stays in the output.

### Prepare your data. Build it in Strata.

Strata opens in your browser, with no account.

[Open Strata](https://oplema.com/editor?path=%2F%3Fopen%3Dstrata) [About Strata](https://oplema.com/strata)
