# exp()

> The `exp()` CSS math function returns the value of `e` raised to the power of a specified number.

## What does exp() do in CSS?

The math function that returns the value of `e` (Euler's number) raised to the power of a given number. It's used in calculations involving exponential growth, decay or other mathematical models in programming.

- Topic: Mathematics
- Type: function
- Browser support: Chrome 120+, Chrome Android 120+, Edge 120+, Firefox 118+, Firefox Android 118+, Safari 15.4+, Safari iOS 15.4+

## Example

Wrong:

```css
.box {
  width: exp(2rem);
}
```

Right:

```css
.box {
  width: calc(exp(2) * 1rem);
}
```

`exp()` only takes numbers and returns a number, so it is multiplied by '1rem' to produce a width.

## Common mistakes

- Passing a length like `exp(2px)`, which is invalid.

## Key points

- The argument is a plain number, not a length or percentage.
- The number result is multiplied by a unit inside `calc()` when a length is needed.
- `pow()` is used instead when the base is not `e`.

## Interview questions

### What is the difference between exp() and pow() in CSS?

`exp(x)` always raises `e` to the power `x`. `pow()` takes any base, like `pow(2, 3)`.

### Is there an e constant in CSS?

Yes. CSS math functions accept the `e` keyword, so `calc(e * 1px)` is valid.

## Related cards

- [pow()](https://wonderium.dev/css/pow.md)
- [log()](https://wonderium.dev/css/log.md)
- [calc()](https://wonderium.dev/css/calc.md)
- [sqrt()](https://wonderium.dev/css/sqrt.md)
- [Math.exp()](https://wonderium.dev/js/math-exp.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/exp
- Last updated: 2026-11-25
