# to() Function & Examples

Use the to() units function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## to

#### x to unit

#### to(x, unit)

Try it yourself:

```calculio
5 inch to cm
3.2kg to g
16 bytes in bits
```

---

## to(): convert a quantity to a unit

**to(value, unit)** converts a quantity into a requested compatible unit. It keeps the underlying physical quantity while changing its representation.

## Example

Convert a length, mass, duration, or temperature only to a compatible target. The result is easier to report but should represent the same measurement.

## Related tools

Use [toBest()](https://calcul.io/function/toBest/index.md) for a readable automatic unit, [format()](https://calcul.io/function/format/index.md) for display, [add()](https://calcul.io/function/add/index.md) for compatible quantities, and [compare()](https://calcul.io/function/compare/index.md) to order values.

## Caveat

Conversion cannot repair incompatible dimensions. Be explicit about offsets such as Celsius versus Kelvin.

[All functions](https://calcul.io/functions/index.md)
