int
a whole number of any size
1# int: a whole number, any size20xff3# in another base40b1010 + 0xff0b1000010015# digits grouped with underscores61_000_0001000000Example outputCtrl+Enter to run
syntax
Section titled “syntax”1# // is whole division, % the remainder217 // 533# ** is the power, with no overflow42 ** 10012676506002282294014967032053765# n! is the factorial65!120Example outputCtrl+Enter to run
Functions that take it
Section titled “Functions that take it”intconvert to an integer, dropping any fractional partfloatconvert to a floatfracshow a number as a fraction, like 7/2, or as text rounded to the nearest 1/den, like “2 11/16 in”exitstop the script now, with an exit code for whatever ran itunicodeeach character’s code point in the standard U+ form, like U+00E9 for échrthe character with the given Unicode code pointbytesa string’s UTF-8 bytes, bytes made from a list of integers 0-255, or an integer’s bytesloremthe classic lorem ipsum paragraph of fake Latin that designers use as filler, or just its first n words (starting over if n is longer)rangethe integers from 0 up to n, or from a up to b, not including the end, or with a step the numbers or quantities betweenprogressa progress bar filled to frac, from 0 (empty) to 1 (full), width characters widesqrtsquare rootabsthe value without its sign, so -3 becomes 3roundround to the nearest whole number, or to digits decimal placessiground to that many significant figures (digits counted from the first non-zero one)floorround down to a whole numberceilround up to a whole numbertruncdrop the fractional part, rounding toward zerosign-1 if x is negative, 0 if it’s zero, 1 if it’s positivecbrtcube rootexpe (2.718…) to the power xlnnatural logarithm, the log base eloglogarithm base 10, or in the base givennth_rootthe nth root of x, so nth_root(27, 3) is 3log2logarithm base 2log10logarithm base 10exp22 to the power xexp1010 to the power xhypotthe length of the long side of a right triangle with sides x and y, sqrt(x² + y²)sumadd up a list, units includedavgthe mean (average), or with weights, the mean where each item counts as many times as its weightproductmultiply all the items togethermedianthe middle value once sorted, or with an even count, halfway between the middle twovariancehow spread out the numbers arestdevhow spread out the numbers are, in the same units as themgeo_meanthe geometric mean: the nth root of the product, the right average for growth factorsharmonic_meanthe harmonic mean: the reciprocal of the average reciprocal, the right average for ratesrmsthe root mean square: the square root of the average of the squaresmadthe median absolute deviation: the median distance from the median, a spread that outliers barely movesemthe standard error of the mean: the standard deviation divided by the square root of the countiqrthe interquartile range: the 75th percentile minus the 25thsinthe sine of an angle, in radians or an angle unitcosthe cosine of an angle, in radians or an angle unittanthe tangent of an angle, in radians or an angle unitasinthe angle whose sine is x (arcsine)acosthe angle whose cosine is x (arccosine)atanthe angle whose tangent is x (arctangent)atan2the angle from the positive x axis to the point (x, y), from -180° to 180°sinhthe hyperbolic sine, (eˣ - e⁻ˣ) / 2coshthe hyperbolic cosine, (eˣ + e⁻ˣ) / 2tanhthe hyperbolic tangent, sinh(x) / cosh(x)cscthe cosecant of an angle, 1 / sin(x)secantthe secant of an angle, 1 / cos(x), not to be confused withsecfor secondscotthe cotangent of an angle, 1 / tan(x)acscthe angle whose cosecant is xasecthe angle whose secant is xacotthe angle whose cotangent is xasinhthe inverse hyperbolic sineacoshthe inverse hyperbolic cosine, for x of 1 or moreatanhthe inverse hyperbolic tangent, for x between -1 and 1sechthe hyperbolic secant, 1 / cosh(x)cschthe hyperbolic cosecant, 1 / sinh(x)coththe hyperbolic cotangent, 1 / tanh(x)sincthe normalized sinc function, sin(pi x) / (pi x), which is 1 at 0gcdgreatest common divisor: the largest integer that divides all of them evenlylcmleast common multiple: the smallest positive integer they all divide evenlyis_primewhether n is primefactorsthe primes that multiply to give n, smallest first, with repeatsfactorialn! = 1 × 2 × … × n, exactdouble_factorialn!! = n × (n - 2) × (n - 4) × … down to 1 or 2, exacthyperfactorial1¹ × 2² × … × nⁿ, exactsuperfactorial1! × 2! × … × n!, exactderangementshow many ways n items can be shuffled so that none ends up in its original place, exactchoosehow many ways there are to pick k things from n when order doesn’t matter (the binomial coefficient), exactpermutationshow many ways there are to pick k things from n when order matters, exactpermthe same as permutationsmod_powthe remainder of b to the power e, divided by m, worked out without ever computing the huge powermod_invthe number b from 0 to m - 1 for which a × b leaves remainder 1 when divided by mremthe remainder of a divided by b, with the same sign as a, as C’s and JavaScript’s%give itfibthe nth Fibonacci number, exactnext_primethe smallest prime greater than nprev_primethe largest prime less than ndivisorsevery positive divisor of n, smallest firstprimesthe primes up to n, or from a up to bprime_counthow many primes are at most nnth_primethe nth prime, so nth_prime(1) is 2digit_sumthe sum of n’s digits, in a base (default 10)digital_rootadd n’s digits again and again until one digit is left, in a base (default 10)bernoullithe Bernoulli number B(n) as an exact fraction, with B(1) = -1/2 and 0 for odd n above 1numeratorthe numerator of a fraction in lowest terms, or of a whole number itselfdenominatorthe denominator of a fraction in lowest terms, or 1 for a whole numberfrac_partthe part of x after the point, keeping its sign: frac_part(-2.25) is -0.25is_evenwhether n is evenis_oddwhether n is oddtotientEuler’s totient φ(n)egcdthe extended gcd of a and b: [g, x, y] with a × x + b × y = g, their gcdirootthe integer k-th root of x, rounded toward zero, and whether it’s exact, as [root, exact]jacobithe Jacobi symbol (a/n) for an odd positive n: 0, 1 or -1legendrethe Legendre symbol (a/p) for an odd prime p: 1 if a is a nonzero square mod p, -1 if it isn’t, 0 if p divides asqrt_modevery x from 0 to p - 1 with x × x leaving remainder a when divided by the prime p, smallest firstdiscrete_logthe smallest x from 0 up with g ** x leaving remainder h when divided by the prime p, the discrete logarithmrsa_dthe private exponent d of textbook RSA, from the primes p and q and the public exponent ersa_encrypttextbook RSA encryption, m ** e mod n, with no paddingrsa_decrypttextbook RSA decryption, c ** d mod n, as an integerisqrtthe integer part of the square root of n, exact at any sizecfracx as a continued fraction, the list [a0, a1, a2, …] meaning a0 + 1/(a1 + 1/(a2 + …))popcounthow many bits are 1bitbit i of n, as 0 or 1, where bit 0 is the lowestset_bitn with bit i turned on (set to 1)clear_bitn with bit i turned off (set to 0)rotltreat n as a width-bit number and rotate it left by krotrtreat n as a width-bit number and rotate it right by kbyteswapreverse the order of the bytes in a width-bit number, converting between little- and big-endianto_fixedx as a fixed-point integer with int_bits whole bits and frac_bits fractional ones, rounded, shown in hexfrom_fixedthe number a fixed-point integer with int_bits whole bits and frac_bits fractional ones stands forbcda non-negative integer in binary-coded decimal, where each decimal digit takes one hex digit, so 1234 is 0x1234from_bcdthe number a binary-coded decimal integer stands for, the reverse of bcdfloat_bitsthe bit pattern of x in a float format, shown in hexfrom_float_bitsthe float with the given bit pattern, the reverse of float_bitsfloat_partsthe sign, exponent and mantissa fields of x as stored, as a mapnearest_floatx rounded to the nearest number a float format can storefloat_errorhow far x is from the nearest number a float format can store, as nearest minus xnormal_pdfthe probability density of a normal distribution at x, how likely values near x arenormal_cdfthe chance that a normal variable is at most xnormal_invthe value that a normal variable falls below with chance p, the reverse of normal_cdft_pdfthe probability density of a Student’s t distribution at x, how likely values near x aret_cdfthe chance that a Student’s t variable is at most xt_invthe value that a Student’s t variable falls below with chance p, the reverse of t_cdfchi2_pdfthe probability density of a chi-squared distribution at x, how likely values near x arechi2_cdfthe chance that a chi-squared variable is at most xchi2_invthe value that a chi-squared variable falls below with chance p, the reverse of chi2_cdff_pdfthe probability density of an F distribution at x, how likely values near x aref_cdfthe chance that an F variable is at most xf_invthe value that an F variable falls below with chance p, the reverse of f_cdfexp_pdfthe probability density of an exponential distribution at x, how likely values near x areexp_cdfthe chance that an exponential variable is at most xexp_invthe value that an exponential variable falls below with chance p, the reverse of exp_cdfgamma_pdfthe probability density of a gamma distribution at x, how likely values near x aregamma_cdfthe chance that a gamma variable is at most xgamma_invthe value that a gamma variable falls below with chance p, the reverse of gamma_cdfbeta_pdfthe probability density of a beta distribution at x, how likely values near x arebeta_cdfthe chance that a beta variable is at most xbeta_invthe value that a beta variable falls below with chance p, the reverse of beta_cdfweibull_pdfthe probability density of a Weibull distribution at x, how likely values near x areweibull_cdfthe chance that a Weibull variable is at most xweibull_invthe value that a Weibull variable falls below with chance p, the reverse of weibull_cdfcauchy_pdfthe probability density of a Cauchy distribution at x, how likely values near x arecauchy_cdfthe chance that a Cauchy variable is at most xcauchy_invthe value that a Cauchy variable falls below with chance p, the reverse of cauchy_cdflogistic_pdfthe probability density of a logistic distribution at x, how likely values near x arelogistic_cdfthe chance that a logistic variable is at most xlogistic_invthe value that a logistic variable falls below with chance p, the reverse of logistic_cdfpareto_pdfthe probability density of a Pareto distribution at x, how likely values near x arepareto_cdfthe chance that a Pareto variable is at most xpareto_invthe value that a Pareto variable falls below with chance p, the reverse of pareto_cdfrayleigh_pdfthe probability density of a Rayleigh distribution at x, how likely values near x arerayleigh_cdfthe chance that a Rayleigh variable is at most xrayleigh_invthe value that a Rayleigh variable falls below with chance p, the reverse of rayleigh_cdfbinom_pmfthe chance of exactly k successes in n tries that each succeed with chance pbinom_cdfthe chance of at most k successes in n tries that each succeed with chance pbinom_invthe fewest successes in n tries with chance p each that are at least as likely as q to be reached, the reverse of binom_cdfpoisson_pmfthe chance of exactly k events when rate of them are expected on averagepoisson_cdfthe chance of at most k events when rate of them are expected on averagepoisson_invthe fewest events that are at least as likely as q to be reached when rate are expected, the reverse of poisson_cdfrand_normala random number from a normal distribution with that mean and sd, or a list of n of themrand_expa random wait from an exponential distribution with that rate, or a list of n of themrand_poissona random event count from a Poisson distribution with that rate, or a list of n of themhexan integer in hex, the same asv to hexbinan integer in binary, the same asv to binoctan integer in octal, the same asv to octdecan integer in decimal, the same asv to decbasean integer in any base from 2 to 62, the same asv to base(b)to_basean integer as text in a base from 2 to 62, or in your own digits:to_base(10, "ab")is “baba”base_tablea one-row table of an integer in binary, octal, decimal and hexcolumn_namethe spreadsheet column letters for column n, counting from 1digitsthe list of a number’s digits, in the base it was written infixedx as text with exactly that many decimals, padding with zeros if neededscix as text in scientific notation, like 1.23e5 for 123000, with digits decimalsengx as text in engineering notation, with the exponent a multiple of 3, like 123.457e6, with digits decimalsmixed_fraca number as a mixed fraction text, like “1 1/4” for 1.25, optionally rounded to the nearest 1/denpercenta fraction as percentage text, so 0.256 is “25.6%”, with digits decimalscommasx as text with commas between thousands, like “1,234,567”, with digits decimalsspellan integer in English words, like “forty-two”short_scalea number as compact text with a short-scale word, like “2.5 million”ordinalthe number with its English ordinal ending: 1st, 2nd, 3rd, 4th, 11th, 21st and so onhuman_bytesa number of bytes as text in the largest binary unit that fits, like “117.7 MiB”, with one decimaldmsan angle as degrees, arcminutes and arcseconds text, like 52°20′24″lata latitude in degrees as text with N or S, like 7°19′48″Slona longitude in degrees as text with E or W, like 74°0′21″Wromana positive integer as a Roman numeral, or a numeral back to an integerranda random decimal from 0 up to but not including 1seedmake the session’s random choices repeatablebirthday_paradoxthe chance that at least two of n people share a birthdayoddsa probability as “1 in N”, with a familiar event that’s about as likely, to give a feel for itcoin“heads” or “tails”, or a list of n flipsrethe real partimthe imaginary part, as a plain numberconjthe complex conjugate: the same number with its imaginary part negatedargthe angle from the positive real axis to the number, as an angle unitcsqrtsquare root that gives a complex number for negatives, so csqrt(-4) is 2icrootsall n complex nth roots of a number, as a listpolarmake a complex number from its polar form, or with one argument show z in that formidentitythe n by n identity matrix: 1 down the diagonal and 0 elsewherematrixa matrix of the given number of rows and columns, filled with fill (0 if left out)gammathe gamma function, which extends the factorial: gamma(n + 1) is n!, and it works between whole numbers toolgammathe natural log of the gamma function, which stays finite where gamma itself is too largebetathe beta function, gamma(a) × gamma(b) / gamma(a + b)erfthe error function: the chance a normal variable lands within x√2 standard deviations of its meanerfcthe complementary error function, 1 - erf(x), accurate even where that would round to 0digammathe digamma function, the slope of lgamma: the derivative of ln(gamma(x))zetathe Riemann zeta function, the sum of 1 / n^s over every whole number n from 1erf_invthe inverse of the error function: the x where erf(x) is y, for y between -1 and 1probitthe normal quantile: the z where a standard normal variable falls below z with chance pgamma_incthe regularized lower incomplete gamma function: the share of gamma(a) accumulated up to x, from 0 to 1beta_incthe regularized incomplete beta function: the share of beta(a, b) accumulated up to x, for x from 0 to 1sigmoidthe logistic curve 1 / (1 + e^-x): an S shape from 0 to 1logitthe inverse of sigmoid, ln(p / (1 - p)), for p between 0 and 1heavisidethe step function: 0 below zero, 1 above, and 1/2 at zerorampthe ramp function: 0 below zero, and x aboverectthe rectangle pulse: 1 for x within 1/2 of zero, 1/2 at the edges, 0 beyondtrithe triangle pulse: 1 at zero, falling in straight lines to 0 at 1 and -1dba ratio of two powers in decibels, as 10 × log10(ratio), so doubling is about +3 dBfrom_dbdecibels back to the ratio of powers, the reverse of dbgrowwhat money will be worth after time at the ratepresent_valuewhat a future sum, and any regular payments up to then, are worth today at the ratenpvthe net present value of a list of cash flows: each is discounted by the rate for every period since the first, which is nowloan_ratethe yearly rate of a loan from its monthly payment (the annual percentage rate, compounding monthly)depreciationa schedule of how an asset loses value over its life, a row per yearcagrthe steady yearly growth rate that would take start to end over time (compound annual growth rate)real_ratewhat a return is really worth once inflation is taken outpaymentthe monthly payment that pays off a loan over time, interest includedpayoffhow long a regular payment takes to pay off a balance with interest, rounded up to whole paymentsamortizea loan’s month-by-month schedulesharesplit a sum into parts, in equal shares or by the weights in a list, rounded to the cent so they still add up exactlychangehow much a value changed, as a fraction of where it startedmarginprofit as a fraction of the selling pricemarkupprofit as a fraction of what it cost youdatea date from text: ISO (2026-12-25), US (12/25/2026), written out (Dec 25 2026) or plain English (next friday at 5pm, 3 days ago)date_msthe date for a Unix timestamp in milliseconds, the form JavaScript and Java useleap_yearwhether the year is a leap yearholidaysa year’s public holidays, on the day they’re taken off when they fall on a weekendcalendara month drawn as a calendar grid, weeks starting on Mondaychinese_zodiacthe Chinese zodiac element and animal for a yearsunrisewhen the sun rises at a place on a day, or nil if it doesn’t rise or doesn’t set that daysunsetwhen the sun sets at a place on a day, or nil if it doesn’t rise or doesn’t set that dayday_lengthhow long the sun is up at a place on a day: 0 h if it never rises, 24 h if it never setsnearestthe city closest to a latitude and longitude, out of those zil knowschmodconvert Unix file permissions between the number form, like 755, and the letters ls -l shows, like “rwxr-xr-x”ipan IPv4 or IPv6 address as a plain integer, or an integer back as an addressportthe service that normally listens on a port number, like “ssh” for 22, or the port for a service name, or nil if unknownpassworda random password of letters, digits and symbolspassphraserandom words joined by dashes, easier to type and remember than a password, each adding about 9.4 bits of strengthnanoida random ID made only of characters that are safe in URLs, about as unlikely to repeat as a UUIDrgbmake a color from red, green and blue amounts (0-255), or give one argument to get a color’s three amountshslmake a color from hue, saturation and lightness, or give one argument to get a color’s three valuesluhnwhether a number passes the Luhn check, the check digit on credit cards and phone IMEIshttp_statusthe standard name for an HTTP status code, like “Not Found” for 404, or nil if it isn’t onep8x as 1 byte, with -128 to -1 come out in two’s complementp16x as 2 bytes, lowest byte first, or highest first if order is “big”p32x as 4 bytes, lowest byte first, or highest first if order is “big”p64x as 8 bytes, lowest byte first, or highest first if order is “big”cyclicn bytes of a pattern in which every run of 4 bytes is different (a de Bruijn sequence), to send to a program with a buffer overflow and see which part ends up wherecyclic_findhow many bytes into the cyclic pattern sub appears, or nilawgthe diameter of American Wire Gauge number gauge, in mmraidthe usable capacity of n disks of size disk in a RAID array of the given levelram_latencythe true latency of memory in ns, from its transfer rate in MT/s and CAS latency clsegmentsbig digits like a digital clock’s, for 0-9, A-F, -, ., : and spacesrulerun a cellular automatonspiralan Ulam spiral: the numbers 1, 2, 3, … wound outward from the center, with a dot for each primestarfielda random night skymandelbrotthe Mandelbrot set, the famous fractal, drawn in ASCII charactersmazea random maze with exactly one path between any two pointsdicedraw a die showing 1 to 6, or several side by side for a list
Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.