Audited 05 Aug 2026·Last updated 28 Oct 2026·3 citations·Tier 2·0 uses

Ceiling Function Calculator

Find the ceiling ⌈x⌉ of any real number: the smallest integer greater than or equal to it. Handles negatives correctly, so ⌈−3.2⌉ is −3, not −4.

Ceiling Function Calculator

Ceiling
4
The smallest integer greater than or equal to the number entered, in the same units as the input.

Background.

Some answers only make sense as whole numbers, and some of those have to be rounded up however small the fraction. If 130 students are travelling in 50-seat buses, 2.6 buses is not an option and 2 buses leaves 30 students behind; you need 3. That round-up-to-the-next-whole-number operation is the ceiling function, written ⌈x⌉. The name and the half-bracket notation come from Kenneth Iverson, who introduced ceiling together with its partner, floor, in 1962.

Formally, ⌈x⌉ is the smallest integer greater than or equal to x. Three consequences of that definition catch people out. Whole numbers stay where they are: ⌈7⌉ = 7, because 7 is itself an integer at least as large as 7. Any fraction, however tiny, pushes the answer up a full step: ⌈2.0000001⌉ = 3. And up means toward positive infinity, not away from zero, so ⌈−3.2⌉ = −3. Ordinary rounding, which would turn 3.2 into 3, plays no part.

Ceiling turns up wherever things come in indivisible units and running short is not acceptable: boxes to ship an order, rolls of wallpaper, screens of results at 20 per page, parking billed per started hour. Computers use it to size memory and storage; a 10,000-byte file stored in 4,096-byte blocks occupies ⌈10,000 ÷ 4,096⌉ = 3 of them. In mathematics it sits inside counting arguments such as the pigeonhole principle: share n items among k boxes and at least one box must hold ⌈n/k⌉ or more.

Enter any real number between minus one billion and one billion and the page returns its ceiling as a single integer.

What is ceiling function calculator?

The ceiling of a real number x, written ⌈x⌉ or ceil(x), is the least integer n with n ≥ x. Equivalently, it is the one integer satisfying ⌈x⌉ − 1 < x ≤ ⌈x⌉. On a number line you find it by moving right from x until you land on an integer, or staying put if x already is one. Ceiling mirrors the floor function through the identity ⌈x⌉ = −⌊−x⌋. For any number that is not an integer, the ceiling is exactly one more than the floor; for integers the two are equal.

How to use this calculator.

  1. Type the number into Real value. Decimals and negative numbers are both accepted, anywhere from −1,000,000,000 to 1,000,000,000.
  2. If your question is a division — people per car, items per box — do the division first and enter the quotient, for example 130 ÷ 50 = 2.6.
  3. When a quotient ought to be exactly a whole number, enter it exactly. A carried-over 6.0001 that should have been 6 will come back as 7.
  4. Read the result, a single integer. For a negative input it lies closer to zero than the input does: −7.9 gives −7.

The formula.

ceil(x) is the least integer greater than or equal to x

⌈x⌉ = the least integer n such that n ≥ x. In practice, if x is already an integer the answer is x; otherwise drop the fractional part and, for a positive number, add 1. For a negative number, dropping the fractional part is already the answer, because truncating −3.2 to −3 moves it upward. The identity ⌈x⌉ = −⌊−x⌋ covers both cases at once. A few properties help when you work with ceilings algebraically: adding a whole number passes straight through, so ⌈x + 3⌉ = ⌈x⌉ + 3; the ceiling is never below x and exceeds it by less than 1; and for positive integers a and b, ⌈a/b⌉ = ⌊(a + b − 1)/b⌋, the trick programmers use to round an integer division up without any decimals. The ceiling is applied directly to the decimal value you type, so no binary rounding error creeps in between your input and the answer.

A worked example.

Example

Sixteen friends are driving to a match in cars with five seats each. The division 16 ÷ 5 = 3.2 is the page's example value. The integers greater than or equal to 3.2 are 4, 5, 6 and upward; the least of them is 4, so ⌈3.2⌉ = 4 and four cars are needed. The floor of 3.2 is 3, exactly one less, as it is for every number that is not an integer. Ordinary rounding would say 3 cars, which seat 15 and leave 1 friend at home — the whole reason to use the ceiling here. Had the value been −3.2 instead, the ceiling would be −3, since moving up from −3.2 reaches −3 first.

value3.2

Frequently asked questions.

What is the ceiling of a negative number?
The next integer toward positive infinity, which for negatives means toward zero. So ⌈−3.2⌉ = −3 and ⌈−7.9⌉ = −7. A common mistake is to think of ceiling as rounding away from zero, which would give −4 and −8; that is a different operation and gives the wrong answer for negative inputs.
Is the ceiling the same as Excel's ROUNDUP?
Only for positive numbers. ROUNDUP rounds away from zero, so ROUNDUP(−3.2, 0) returns −4, whereas the mathematical ceiling of −3.2 is −3. Spreadsheets also have CEILING-type functions that round to a chosen multiple; for ordinary whole-number ceilings, check how your version treats negative inputs before relying on it.
Why does my program return 111 when I round 1.1 × 100 up?
Binary floating point cannot store 1.1 exactly, so in JavaScript 1.1 * 100 evaluates to 110.00000000000001, and its ceiling is 111. Ceiling is unforgiving of such specks. Round to a sensible precision before taking the ceiling, use integer arithmetic such as ⌊(a + b − 1)/b⌋, or use a decimal library.
How do I round up to two decimal places or to the next multiple of 5?
Scale, take the ceiling, then scale back. For two decimal places use ⌈100x⌉ ÷ 100, so 2.341 becomes ⌈234.1⌉ ÷ 100 = 2.35. For the next multiple of 5 use ⌈x ÷ 5⌉ × 5, so 23 becomes ⌈4.6⌉ × 5 = 25. The same pattern works for any step size.
How do ceiling, floor and truncation differ?
Ceiling moves toward positive infinity, floor toward negative infinity, and truncation simply chops off the fractional part, moving toward zero. For 3.2 they give 4, 3 and 3. For −3.2 they give −3, −4 and −3. Truncation therefore matches floor for positive numbers and ceiling for negative ones.

How this page was produced

Published by
Quanta Calculator
Primary sources
3 cited below
Method
ceil(x) is the least integer greater than or equal to x
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon