← All tools

Integer Root & Square Root

Compute the integer floor of an nth root of any non-negative integer, exactly, with big integers: r = ⌊n1/k — the largest integer r such that rk ≤ n. The special case k = 2 is the integer square root. The tool reports whether n is a perfect kth power (i.e. rk = n) and shows the remainder n − rk. Useful for number theory, primality work, and exact large-integer arithmetic. Runs locally in your browser.

Input

n =
k =

Result

The integer kth root of n is ⌊n1/k — the largest r with rk ≤ n. It is computed here with integer Newton's method (r ← ((k−1)·r + n/rk−1) / k, integer division) starting from a bit-length estimate, which is exact and works for arbitrarily large n. When rk = n the input is a perfect kth power (e.g. ∛729 = 9, √499849 = 707); otherwise the remainder n − rk is shown. k = 2 gives the integer square root; k = 1 returns n itself. Pairs with the Pythagorean Triples and Prime Factorization tools. Everything runs locally — nothing leaves your browser.