JavaScript floor

Math.floor() rounds a number DOWN to the nearest integer — "floor". 4.9 becomes 4, and -4.1 becomes -5.

Syntax

Math.floor(num)

Examples

Input Arguments Output
4.9 4

Try it live

Type your input and see floor transform it instantly.

Description: Rounds a number down to the nearest integer.

Example: floor 3.99 => 3

Want to go further? Chain floor with other functions in the visual Playground — pipe one output into the next and watch your data transform.

Related functions

© 2026 Heifara Buval