gives the number of digits in the base 10 representation of the integer n.
IntegerLength[n,b]
gives the number of digits in the base b representation of n.


IntegerLength
gives the number of digits in the base 10 representation of the integer n.
IntegerLength[n,b]
gives the number of digits in the base b representation of n.
Details

- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- IntegerLength[n,b] is effectively an efficient version of Floor[Log[b,n]]+1.
- IntegerLength ignores the sign of n.
- IntegerLength automatically threads over lists.
Examples
open all close allBasic Examples (4)
Find the number of decimal digits in 123456789:
The number of binary digits in :
The IntegerLength for different bases:
Tech Notes
Related Guides
History
Text
Wolfram Research (2007), IntegerLength, Wolfram Language function, https://reference.wolfram.com/language/ref/IntegerLength.html.
CMS
Wolfram Language. 2007. "IntegerLength." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IntegerLength.html.
APA
Wolfram Language. (2007). IntegerLength. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IntegerLength.html
BibTeX
@misc{reference.wolfram_2025_integerlength, author="Wolfram Research", title="{IntegerLength}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/IntegerLength.html}", note=[Accessed: 11-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_integerlength, organization={Wolfram Research}, title={IntegerLength}, year={2007}, url={https://reference.wolfram.com/language/ref/IntegerLength.html}, note=[Accessed: 11-August-2025]}