---
title: "math.ceil"
space: "Student Handbook"
url: "https://portal.cs17.org/student-handbook/python-manual/math/ceil"
updated: "2026-10-05"
---

Rounds a number up.

## Synopsis

```python
import math
math.ceil(number)
```

## Description

Use `ceil` when a part needs a whole one: 10 pupils in groups of 3 need 4 groups, not 3.

## Parameters

| Name | Meaning |
| --- | --- |
| `number` | An int or a float. |

## Return value

An `int`.

## Example

```python
import math

print(math.ceil(3.2))
print(math.ceil(10 / 3))
```

It prints:

```text
4
4
```

## Common mistake

```python
print(10 // 3)
```

It prints:

```text
3
```

Not an error, but a wrong answer for the groups problem: `//` rounds down, so one pupil is left out.

## See also

[math.floor](/student-handbook/python-manual/math/floor), [round](/student-handbook/python-manual/built-in-functions/round)

[math.ceil in the Python documentation](https://docs.python.org/3/library/math.html#math.ceil)
