Maximum of two numbers

Type a and b. The result is the larger of a and b. 3 and 7 give 7. −2 and 5 give 5. 4 and 4 give 4.

Two fields, one number. This is not the min / max / range card. An empty field is a blank value and a blank. An integer max goes as a string.

Input data

Results

Enter data and click Calculate.

How it works

Maximum of two numbers returns the larger one. The calculator takes the larger of a and b. 3 and 7 give 7. −2 and 5 give 5. 4 and 4 give 4, because both are equal.

The fields are a and b. Order does not change the result. 7 and 3 also give 7. A winning fraction would get six decimal places: 2.5 and 1 give 2.500000.

An empty field is a blank value. a blank field and 7 leaves a blank, not 7. Zero is a number: 0 and −3 give 0.

Minimum and maximum of three numbers, with a range, is on the neighbouring page. There its own card and three strings. Range from a list in one field is another calculator.

The header units switch does not multiply anything. 3 and 7 stay 7 whatever the label says.

3 and 7 give 7. −2 and 5 give 5. 4 and 4 give 4.

Formula

max(a, b)

How to use

  1. Type two numbers, for example 3 and 7.
  2. Click Calculate. The maximum comes out 7.
  3. −2 and 5 give 5. 4 and 4 give 4.
  4. An empty field leaves a blank, not the other number.
  5. Min, max and range with a third number live on the neighbouring card.

3 and 7 give 7

Maximum is the larger of a and b. 3 and 7 give 7. −2 and 5 give 5. 4 and 4 give 4.

Maximum
The larger of two. 3 and 7 give 7. −2 and 5 give 5.
two
Two fields a and b. No third number. No range.
numbers
Any a and b. 4 and 4 stay 4. Empty leaves a blank.

Examples

Example 1

  • a = 3
  • b = 7

7

Which is larger, 3 or 7? 7. maximum.

Example 2

  • a = −2
  • b = 5

5

Which is larger, −2 or 5? 5.

Example 3

  • a = 4
  • b = 4

4

Which is larger, 4 or 4? 4. Equals stay 4.

Related calculators

Common questions

Which is larger, 3 or 7?

The result is 7, the larger of 3 and 7.

What does maximum of two numbers mean?

The larger of a and b. One result. No minimum and no range.

What about −2 and 5?

5. A minus does not beat a plus.

What about 4 and 4?

4. Equal numbers, the same max.

What if a field is empty?

a blank value. a blank field and 7 leaves a blank.

Does 0 beat a minus?

Yes. 0 and −3 give 0.

Does a fraction get six places?

Yes, when max is not an integer. 2.5 and 1 give 2.500000.

Where are min and range?

On the minimum and maximum of numbers card. There three results.

Does the order of a and b change the result?

No. 7 and 3 also give 7.

Does a comma in 2.5 work?

Yes. 2.5 and 2,5 are the same number.

Knowledge sources

The calculator computes the same formula as the definition below.

Page updated in 2026.