---
schema_version: "1"
id: 525df5358ca809422337b66f89ea5d318a4ccc0ccb66c561c1fb2ac3e825032a
title: Expression Operators
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/variables/pages-variables-operators.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-variables-operators.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d852e73ce561dd22688f3e4c4cc9363bd01842b49ddb2f0dfbcaedf53a25cdd4
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Expression Operators

Use operators to join expressions together to create compound expressions.

Operators must be used within Visualforce expression syntax to be evaluated.Visualforce supports the following operators.

## Math Operators

| Operator | Description                                                                                                                                                                   | Use                                                                                                                                                                                        |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `+`      | Calculates the sum of two values.                                                                                                                                             | `value1 + value2` and replace each _value_ with merge fields, expressions, or other numeric values.                                                                                        |
| `-`      | Calculates the difference of two values.                                                                                                                                      | `value1 - value2` and replace each _value_ with merge fields, expressions, or other numeric values.                                                                                        |
| `*`      | Multiplies its values.                                                                                                                                                        | `value1 * value2` and replace each _value_ with merge fields, expressions, or other numeric values.                                                                                        |
| `/`      | Divides its values.                                                                                                                                                           | `value1 / value2` and replace each _value_ with merge fields, expressions, or other numeric values.                                                                                        |
| `^`      | Raises a number to a power of a specified number.                                                                                                                             | _number^integer_ and replace _number_ with a merge field, expression, or another numeric value; replace _integer_ with a merge field that contains an integer, expression, or any integer. |
| `()`     | Specifies that the expressions within the open parenthesis and close parenthesis are evaluated first. All other expressions are evaluated using standard operator precedence. | _(expression1) expression2..._ and replace each _expression_ with merge fields, expressions, or other numeric values.                                                                      |

## Logical Operators

**note:** You can’t have a relative comparison expression that includes a `null` value. Doing so results in an exception. Specifically, you can’t have a `null` value on either side of the following operators:

- `<` (less than)
- `<=` (less than or equals)
- `>` (greater than)
- `>=` (greater than or equals)

| Operator      | Description                                                                                                                          | Use                                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `=` and `==`  | Evaluates if two values are equivalent. The = and == operators are interchangeable.                                                  | _expression1=expression2_ or _expression1 == expression2_, and replace each _expression_ with merge fields, expressions, or other numeric values.    |
| `<>` and `!=` | Evaluates if two values aren’t equivalent.                                                                                           | _expression1 <> expression2_ or _expression1 != expression2_, and replace each `expression` with merge fields, expressions, or other numeric values. |
| `<`           | Evaluates if a value is less than the value that follows this symbol.                                                                | _value1 < value2_ and replace each `value` with merge fields, expressions, or other numeric values.                                                  |
| `>`           | Evaluates if a value is greater than the value that follows this symbol.                                                             | _value1 > value2_ and replace each _value_ with merge fields, expressions, or other numeric values.                                                  |
| `<=`          | Evaluates if a value is less than or equal to the value that follows this symbol.                                                    | _value1 <= value2_ and replace each `value` with merge fields, expressions, or other numeric values.                                                 |
| `>=`          | Evaluates if a value is greater than or equal to the value that follows this symbol.                                                 | _value1 >= value2_ and replace each `value` with merge fields, expressions, or other numeric values.                                                 |
| `&&`          | Evaluates if two values or expressions are both true. Use this operator as an alternative to the logical function AND.               | `(logical1) && (logical2)` and replace _logical1_ and _logical2_ with the values or expressions that you want evaluated.                             |
| `\|\|`        | Evaluates if at least one of multiple values or expressions is true. Use this operator as an alternative to the logical function OR. | `(logical1) \|\| (logical2)` and replace any number of logical references with the values or expressions you want evaluated.                         |

## Text Operators

| Operator | Description                   | Use                                                                                          |
| -------- | ----------------------------- | -------------------------------------------------------------------------------------------- |
| `&`      | Connects two or more strings. | _string1&string2_ and replace each _string_ with merge fields, expressions, or other values. |
