---
title: "log function in Strata | Oplema"
description: "Calculate the logarithm of a number, in base 10 by default or in a base you choose. For example, log(100) returns 2.0. Works in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/log"
updated: "2026-11-04"
---

# log

Calculate a logarithm. With one argument it uses base 10, and with two the first argument is the base.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **DOUBLE**.

### Expression

```
log(100)
```

### Result

```
2.0
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | 2 |

## Arguments and types

```
log([b, ]x)
```

**b**

Number

**x**

Number

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[ln

Calculate the natural logarithm (base e) of a number.

](https://oplema.com/docs/strata/functions/ln)[acos

Computes the arccosine of x.

](https://oplema.com/docs/strata/functions/acos)[acosh

Computes the inverse hyperbolic cos of x.

](https://oplema.com/docs/strata/functions/acosh)[asin

Computes the arcsine of x.

](https://oplema.com/docs/strata/functions/asin)

[Browse numbers](https://oplema.com/docs/strata/functions#numbers) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/numeric.html#logx)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
