> ## Documentation Index
> Fetch the complete documentation index at: https://learn.workflow.dog/llms.txt
> Use this file to discover all available pages before exploring further.

# Map Range

> Convert a number's position in one range to another range.

The **Map Range** action linearly maps a value from an input range to the
corresponding position in an output range. Use it for percentages, scores,
coordinates, and unit-like scaling.

## Inputs

| Input             | Type    | Required | Description                                                     |
| ----------------- | ------- | -------- | --------------------------------------------------------------- |
| **Number**        | Number  | Yes      | The value to map.                                               |
| **In Min**        | Number  | Yes      | The start of the input range.                                   |
| **In Max**        | Number  | Yes      | The end of the input range.                                     |
| **Out Min**       | Number  | Yes      | The corresponding start of the output range.                    |
| **Out Max**       | Number  | Yes      | The corresponding end of the output range.                      |
| **Clamp Result?** | Boolean | No       | Keeps the result within the output bounds. Defaults to `false`. |

## Outputs

| Output     | Type   | Description                             |
| ---------- | ------ | --------------------------------------- |
| **Result** | Number | The value mapped into the output range. |

## Example

Map a five-star rating into a percentage:

| Setting     | Value |
| ----------- | ----- |
| **Number**  | `4`   |
| **In Min**  | `1`   |
| **In Max**  | `5`   |
| **Out Min** | `0`   |
| **Out Max** | `100` |

The result is `75`.

When clamping is off, values outside the input range are extrapolated. In the
example above, a rating of `6` maps to `125`. Turn on **Clamp Result?** to return
`100` instead.

<Note>
  Reversed output ranges are supported. Clamping uses the lower and upper
  numeric output bounds regardless of their direction.
</Note>

<Warning>
  **In Min** and **In Max** must be different. Equal input bounds cause a
  division by zero and produce a non-finite result.
</Warning>
