> For the complete documentation index, see [llms.txt](https://docs.onum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onum.com/pipelines/actions/transformation/field-transformation/field-transformation-operations/conversion/convert-data-units.md).

# Convert data units

## Description

This operation converts values between different units of digital data, such as bits, bytes, kilobytes, megabytes, and so on. It’s especially useful when you’re dealing with data storage or transfer rates and you need to switch between binary (base 2) and decimal (base 10) units.

***

## Data types

These are the input/output expected data types for this operation:

### Input data

`String` - Values whose unit of data you want to transform. They must be strings representing numbers.

### Output data <a href="#output-data" id="output-data"></a>

`String` - Resulting values after transforming them to the selected unit of data.

***

## Parameters

These are the parameters you need to configure to use this operation (mandatory parameters are marked with a <mark style="color:red;">**\***</mark>):

<details>

<summary>Input units<mark style="color:red;"><strong>*</strong></mark></summary>

Enter the unit of your input data. You must indicate one of the following:

* `Bits (b)`
* `Nibbles`
* `Octets`
* `Bytes (B)`

**Binary bits (2^n)**

* `Kibibits (Kib)`
* `Mebibits (Mib)`
* `Gibibits (Gib)`
* `Tebibits (Tib)`
* `Pebibits (Pib)`
* `Exbibits (Eib)`
* `Zebibits (Zib)`
* `Yobibits (Yib)`

**Decimal bits (10^n)**

* `Decabits`
* `Hectobits`
* `Kilobits (Kb)`
* `Megabits (Mb)`
* `Gigabits (Gb)`
* `Terabits (Tb)`
* `Petabits (Pb)`
* `Exabits (Eb)`
* `Zettabits (Zb)`
* `Yottabits (Yb)`

**Binary bytes (8 x 2^n)**

* `Kibibytes (KiB)`
* `Mebibytes (MiB)`
* `Gibibytes (GiB)`
* `Tebibytes (TiB)`
* `Pebibytes (PiB)`
* `Exbibytes (EiB)`
* `Zebibytes (ZiB)`
* `Yobibytes (YiB)`

**Decimal bytes (8 x 10^n)**

* `Kilobytes (KB)`
* `Megabytes (MB)`
* `Gigabytes (GB)`
* `Terabytes (TB)`
* `Petabytes (PB)`
* `Exabytes (EB)`
* `Zettabytes (ZB)`
* `Yottabytes (YB)`

</details>

<details>

<summary>Output units<mark style="color:red;"><strong>*</strong></mark></summary>

Enter the required unit of your output data. You must indicate one of the following:

* `Bits (b)`
* `Nibbles`
* `Octets`
* `Bytes (B)`

**Binary bits (2^n)**

* `Kibibits (Kib)`
* `Mebibits (Mib)`
* `Gibibits (Gib)`
* `Tebibits (Tib)`
* `Pebibits (Pib)`
* `Exbibits (Eib)`
* `Zebibits (Zib)`
* `Yobibits (Yib)`

**Decimal bits (10^n)**

* `Decabits`
* `Hectobits`
* `Kilobits (Kb)`
* `Megabits (Mb)`
* `Gigabits (Gb)`
* `Terabits (Tb)`
* `Petabits (Pb)`
* `Exabits (Eb)`
* `Zettabits (Zb)`
* `Yottabits (Yb)`

**Binary bytes (8 x 2^n)**

* `Kibibytes (KiB)`
* `Mebibytes (MiB)`
* `Gibibytes (GiB)`
* `Tebibytes (TiB)`
* `Pebibytes (PiB)`
* `Exbibytes (EiB)`
* `Zebibytes (ZiB)`
* `Yobibytes (YiB)`

**Decimal bytes (8 x 10^n)**

* `Kilobytes (KB)`
* `Megabytes (MB)`
* `Gigabytes (GB)`
* `Terabytes (TB)`
* `Petabytes (PB)`
* `Exabytes (EB)`
* `Zettabytes (ZB)`
* `Yottabytes (YB)`

</details>

***

## Example

Suppose you want to convert a series of events from **megabits** into **kilobytes**:

1. In your Pipeline, open the required [Action](/pipelines/actions.md) configuration and select the input **Field**.
2. In the **Operation** field, choose **Convert data units**.
3. Set **Input units** to `Megabits (Mb)`.
4. Set **Output units** to `Kilobytes (KB)`.
5. Give your **Output field** a name and click **Save**. The data type of the values in your input field will be transformed. For example:

```
Input data - "2"

Input units - "Megabits (Mb)"

Output units - "Kilobytes (KB)"

Output data - "250"
```

{% hint style="info" %}
You can try out operations with specific values using the **Input** field above the operation. You can enter the value in the example above and check the result in the **Output** field.
{% endhint %}
