# typeOf() Function & Examples

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

## typeOf

#### typeOf(x)

Try it yourself:

```calculio
typeOf(3.5)
typeOf(2 - 4i)
typeOf(45 deg)
typeOf("hello world")
```

---

## typeOf(): identify a value type

**typeOf(x)** reports the type of x, such as number, string, array, matrix, or unit. It is helpful when formulas receive varied inputs.

## Validate before processing

Type inspection prevents applying numeric operations to text or treating a scalar as a collection. Pair it with [isNumeric()](https://calcul.io/function/isNumeric/index.md), [isInteger()](https://calcul.io/function/isInteger/index.md), and [size()](https://calcul.io/function/size/index.md) for more precise checks.

## Related utilities

Use [clone()](https://calcul.io/function/clone/index.md) to copy structured data, [parse()](https://calcul.io/function/parse/index.md) to turn text into expressions, and [format()](https://calcul.io/function/format/index.md) to create output.

## Caveat

A type check does not prove a value is valid for every operation; also validate shape, range, and unit compatibility.

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