# OneHotEncoder

**Compatibility:** `categorical` data

The `OneHotEncoder` transforms data that represents unordered, categorical values into multiple columns -- one for each category. These new columns have `0` and `1` values. A `1` indicates the correct, original category.

![In this example, VISA is encoded in the credit\_card.value0 column, AMEX is encoded in the credit\_card.value1 column, etc.](https://2225246359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVGX92M819eIp0rMg5elc%2Fuploads%2F6vA9gDfcIC4tbHrWsLue%2Frdt_transformers-glossary-categorical-one-hot-encoder_June%2002%202025.png?alt=media\&token=98f4601d-68c5-43a7-9cd3-6314501cb6a5)

```python
from rdt.transformers.categorical import OneHotEncoder
ohe = OneHotEncoder()
```

{% hint style="warning" %}
The `OneHotEncoder` creates a new column for each category in your input data. If you have a large number of categories, it will create a large number of new columns. Each extra column uses more memory and increases the RDT processing time. If this is a concern, consider using other transformers like the [LabelEncoder](https://docs.sdv.dev/rdt/transformers-glossary/categorical/labelencoder) instead.
{% endhint %}

## Parameters

No parameters are available for this transformer.

## FAQs

<details>

<summary>What happens to missing values?</summary>

This transformer treats missing values as if they are a new category of data.

</details>
