Prime Factorization

Enter a number to factor it into primes, check primality, and see the nearest primes above and below - all computed instantly in your browser.

Composite
360 = 2³ × 3² × 5

Nearest primes

Previous prime (below n) 359
Next prime (above n) 367

About this number

Prime factors 3 distinct
Total prime factors 6 (with multiplicity)
Divisors 24
Largest prime factor 5

Factor pairs

Factor pair Product
1 × 360 360
2 × 180 360
3 × 120 360
4 × 90 360

360 has 12 factor pairs.

How it works

Trial division

Factors are found by dividing out 2 and 3, then testing candidates of the form 6k ± 1 up to √n - every prime above 3 has that form.

Exact integer math

Since inputs are capped at 2⁵³ − 1, all divisions and products stay within JavaScript's exact integer range, with BigInt powering the primality checks.

Nearest primes

Nearby primes are verified with a deterministic Miller-Rabin test - exact and instant for every number below 2⁵³.