Formula Components

Formulas and Databases

Reference

Formula Examples

pow

Learn how to use the exponentiation (^) operator in Notion formulas.

The **power (****)** operator (also known as the *exponentiation *operator) allows you to raise a number to a higher power.

`^`

1

number[base] ^ number[exponent]

2

pow(number[base], number[exponent])

In technical terms, it raises the first operand to the power of the second operand.

In Notion, the **right-to-left** associativity.

`^`

operator has a higher operator precedence than the unaryPlus and unaryMinus operators, and has You can also use the function version,

`pow()`

.1

3 ^ 4 // Output: 81

2

β

3

pow(4,3) // Output: 64

4

β

5

2 ^ 2 ^ 3 // Output: 256 - evaluates as 2 ^ (2 ^ 3)

Useful exponent/power rules to remember

In Notion, the **right-to-left** associativity, which means that

`^`

operator has `x ^ y ^ z`

is evaluated as `x ^ (y ^ z)`

.1

4 ^ 3 ^ 2 == 262,144

2

β

3

4 ^ (3 ^ 2) == 4 ^ 9 == 262,144

4

β

5

(4 ^ 3) ^ 2 == 64 ^ 2 == 4,096

6

β

7

// Here's that last one according to the (x^a)^b == x^(ab) "Power Rule":

8

β

9

(4 ^ 3) ^ 2 == 4 ^ (3*2) == 4 ^ 6 = 4,096

Not every programming and scripting language uses right-to-left associativity for serial exponentiation. Here's a write-up comparing the methods for many popular languages. Even though standard mathematical notation has the **"Tower Rule"**, where

$x^{a^b} = x^{(a^b)}$

(aka: "Work top-down"), the computer science community has not come to a strong consensus on whether `x^y^z`

should be interpreted in the same way.`()`

to make the order of your operations explicit.In Notion, the unaryPlus operator converts strings and Booleans to numbers, while the unaryMinus operator inverts the sign of its operand.

When combining these operators with the

`^`

operator in Notion, it's useful to understand the following rules:- 1.The
`^`

operator has a higher operator precedence than the unary operators. This is opposite to JavaScript's operator precedence!*(Though in JavaScript this is irrelevant, because the language**doesn't allow for ambiguous unary operator usage**in exponentiation).* - 2.Notion is smart and will allow for unaryPlus type conversion on the exponent, but will wrap the conversion operation in
`()`

automatically. - 3.Notion will
*not*allow for automatic unaryPlus type conversion on the base number - e.g.`+"8"^2`

will throw a type mismatch error. - 4.If you write a negative exponent into a formula, Notion parses it as a true negative value instead of a unaryMinus (
`-`

) operator appended to a number. Your formula will also be re-written to`x ^ (-2)`

so the exponent is explicitly defined as negative. - 5.When using unaryMinus on a base number, Notion will parse it as
`-(x^y)`

, not`(-x)^y`

.*Note that this can result in mathematically incorrect answers depending on your use case - see**Negative Base Numbers**below.*

1

-2 ^ 2 // Output: -4 - Notion parses this as -(2^2)

2

β

3

4 ^ -2 // Re-written to 4 ^ (-2), outputs 0.0625

4

4 ^ -(2) // Re-written to 4 ^ (-2), outputs 0.0625

5

4 ^ -(-2) // Re-written to 4 ^ (-(-2)), outputs 16

6

β

7

+"8" ^ 2 // Type mismatch error

8

β

9

(+"8") ^ 2 // Output: 64

10

β

11

8 ^ +"-2" // Re-written to 8 ^ (+"-2"), outputs 0.015625

12

β

13

2 ^ +false// Re-written to 2 ^ (+false), outputs 1

If you type **-16**. Assuming you're intending to pass the actual base number **16**.

`-2^4`

directly into Notion's formula box, you'll get an output of `-2`

, this answer is incorrect! The true answer is Remember that exponentiation is just repeated multiplication of the base number. Therefore:

1

-2^4 == (-2)(-2)(-2)(-2) == (4)(-2)(-2) == (-8)(-2) == 16

So why does

`-2^4`

return -16 in a Notion formula?This happens because when you type *not *simply typing a negative number into your formula. Rather, you're creating an expression equivalent to

`-`

directly into a Notion formula, you're using the unaryMinus operator. If you type `-2`

, you're `-(2)`

.This distinction is important because exponentiation (

`^`

) has a higher operator precedence in Notion than unaryMinus, as noted above.This means that typing

`-2^4`

is equivalent to `-(2^4)`

!If your intention is to express a negative base number, you'll need to type

`(-2)^4`

instead.Negative base numbers passed via a property (e.g.

`prop("num")`

) will be evaluated correctly, since they're actually passing a negative value, rather than adding a hard-coded unaryMinus (`-`

) operator to your formula.1

-2^4 // Output: -16 - Notion parses this as -(2^4)

2

β

3

(-2)^4 // Output 16 - Notion parses this as (-2)^4

4

β

5

prop("num") == -2

6

prop("num")^4 // Output: 16 - Notion parses this as (-2)^4

`=-2^4`

evaluates to `=A1^4`

where the value of `A1`

is The table below shows exponentiation at work in a Notion database.

pow

College Info Geek on Notion

1

prop("Base") ^ prop("Exponent")

Instead of using hard-coded numbers, Iβve called in each property using the

`prop()`

function.β My name is Thomas Frank, and I'm a Notion-certified writer, YouTuber, and template creator. I've been using Notion since 2018 to organize my personal life and to run my business and YouTube channel. In addition to this formula reference, I've created a free Notion course for beginners and several productivity-focused Notion templates. If you'd like to connect, follow me on Twitter.

Last modified 21d ago

Copy link

On this page

Example Formulas

Exponent Associativity

Working with Unary Operators

Negative Base Numbers

Example Database

View and Duplicate Database

"Power" Property Formula:

Further Reading