Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
RealDigits
  • See Also
    • MantissaExponent
    • IntegerDigits
    • NumberDigit
    • BaseForm
    • FromDigits
    • ContinuedFraction
    • MultiplicativeOrder
    • ChampernowneNumber
    • FindTransientRepeat
    • DecimalForm
    • Rationalize
  • Related Guides
    • Number Digits
    • Constructing Lists
    • Representation of Numbers
    • Numerical Evaluation & Precision
    • Number Theory
    • Atomic Elements of Expressions
  • Tech Notes
    • Digits in Numbers
    • See Also
      • MantissaExponent
      • IntegerDigits
      • NumberDigit
      • BaseForm
      • FromDigits
      • ContinuedFraction
      • MultiplicativeOrder
      • ChampernowneNumber
      • FindTransientRepeat
      • DecimalForm
      • Rationalize
    • Related Guides
      • Number Digits
      • Constructing Lists
      • Representation of Numbers
      • Numerical Evaluation & Precision
      • Number Theory
      • Atomic Elements of Expressions
    • Tech Notes
      • Digits in Numbers

RealDigits[x]

gives a list of the digits in the approximate real number x, together with the number of digits that are to the left of the decimal point.

RealDigits[x,b]

gives a list of base‐b digits in x.

RealDigits[x,b,len]

gives a list of len digits.

RealDigits[x,b,len,n]

gives len digits starting with the coefficient of bn.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Generalizations & Extensions  
Applications  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Tech Notes
Related Guides
Related Links
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • MantissaExponent
    • IntegerDigits
    • NumberDigit
    • BaseForm
    • FromDigits
    • ContinuedFraction
    • MultiplicativeOrder
    • ChampernowneNumber
    • FindTransientRepeat
    • DecimalForm
    • Rationalize
  • Related Guides
    • Number Digits
    • Constructing Lists
    • Representation of Numbers
    • Numerical Evaluation & Precision
    • Number Theory
    • Atomic Elements of Expressions
  • Tech Notes
    • Digits in Numbers
    • See Also
      • MantissaExponent
      • IntegerDigits
      • NumberDigit
      • BaseForm
      • FromDigits
      • ContinuedFraction
      • MultiplicativeOrder
      • ChampernowneNumber
      • FindTransientRepeat
      • DecimalForm
      • Rationalize
    • Related Guides
      • Number Digits
      • Constructing Lists
      • Representation of Numbers
      • Numerical Evaluation & Precision
      • Number Theory
      • Atomic Elements of Expressions
    • Tech Notes
      • Digits in Numbers

RealDigits

RealDigits[x]

gives a list of the digits in the approximate real number x, together with the number of digits that are to the left of the decimal point.

RealDigits[x,b]

gives a list of base‐b digits in x.

RealDigits[x,b,len]

gives a list of len digits.

RealDigits[x,b,len,n]

gives len digits starting with the coefficient of bn.

Details

  • RealDigits gives the most significant digits first, as in standard positional notation.
  • RealDigits[x] normally returns a list of digits of length Round[Precision[x]].
  • RealDigits[x] and RealDigits[x,b] normally require that x be an approximate real number, returned for example by N. RealDigits[x,b,len] also works on exact numbers.
  • For integers and rational numbers with terminating digit expansions, RealDigits[x] returns an ordinary list of digits. For rational numbers with non‐terminating digit expansions, it yields a list of the form {a1,a2,…,{b1,b2,…}} representing the digit sequence consisting of the ai followed by infinite cyclic repetitions of the bi. »
  • If len is larger than Precision[x]/Log[10,b], then remaining digits are filled in as Indeterminate.
  • RealDigits[x,b,len,n] starts with the digit which is the coefficient of bn, truncating or padding with zeros as necessary. »
  • RealDigits[x,b,len,-1] starts with the digit immediately to the right of the base‐b decimal point in x.
  • RealDigits[x,b,Automatic,n] gives as many digits as it can in a fixed-precision number.
  • The base b in RealDigits[x,b] need not be an integer. For any real b such that b>1, RealDigits[x,b] successively finds the largest integer multiples of powers of b that can be removed while leaving a non‐negative remainder.
  • RealDigits[x] discards the sign of x.
  • RealDigits[0.] gives {{0},-Floor[Accuracy[0.]]}.
  • FromDigits can be used as the inverse of RealDigits.

Examples

open all close all

Basic Examples  (3)

Give the list of digits and exponent:

Give 25 digits of in base 10:

Give 25 digits of 19/7:

Give an explicit recurring decimal form:

Scope  (3)

Base-2 digits:

20 digits starting with the coefficient of :

20 digits starting with the coefficient of :

Noninteger bases are allowed:

Generalizations & Extensions  (2)

RealDigits gives Indeterminate if more digits than the precision are requested:

Start at the coefficient of :

Include only digits that are determined by the precision available:

Applications  (6)

The 10000^(th) digit of is an 8:

Number of 1s in the first million base-2 digits of :

Distribution of first 100000 digits of in base 47:

Fibonacci representations of integers:

Binary representation of a machine number:

TemplateBox[{MachinePrecision, paclet:ref/MachinePrecision}, RefLink, BaseStyle -> {InlineFormula}] is equal to the number of bits times :

Get the next larger machine number:

The spacing between these numbers is 2(e-1) $MachineEpsilon:

Find the error in representing 1/10 with a machine number:

The next smaller machine number is farther away:

Properties & Relations  (1)

The default number of digits returned is determined by the precision of the number:

Possible Issues  (2)

Digits unknown at the available precision are filled in as Indeterminate:

For non-binary bases, the digits given may not be enough to reconstruct the number exactly:

More than Round[MachinePrecision] decimal digits are required to separate x from 1:

InputForm uses a sufficient number of digits to uniquely reconstruct the number:

Neat Examples  (1)

A hundred digits of starting with the millionth digit:

See Also

MantissaExponent  IntegerDigits  NumberDigit  BaseForm  FromDigits  ContinuedFraction  MultiplicativeOrder  ChampernowneNumber  FindTransientRepeat  DecimalForm  Rationalize

Function Repository: NthDigit  RealToHexString

Tech Notes

    ▪
  • Digits in Numbers

Related Guides

    ▪
  • Number Digits
  • ▪
  • Constructing Lists
  • ▪
  • Representation of Numbers
  • ▪
  • Numerical Evaluation & Precision
  • ▪
  • Number Theory
  • ▪
  • Atomic Elements of Expressions

Related Links

  • MathWorld
  • ▪ Implementation notes: Numerical and Related Functions
  • An Elementary Introduction to the Wolfram Language : More about Numbers
  • NKS|Online  (A New Kind of Science)

History

Introduced in 1991 (2.0) | Updated in 1996 (3.0) ▪ 1999 (4.0) ▪ 2000 (4.1) ▪ 2002 (4.2) ▪ 2003 (5.0) ▪ 2007 (6.0)

Wolfram Research (1991), RealDigits, Wolfram Language function, https://reference.wolfram.com/language/ref/RealDigits.html (updated 2007).

Text

Wolfram Research (1991), RealDigits, Wolfram Language function, https://reference.wolfram.com/language/ref/RealDigits.html (updated 2007).

CMS

Wolfram Language. 1991. "RealDigits." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/RealDigits.html.

APA

Wolfram Language. (1991). RealDigits. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RealDigits.html

BibTeX

@misc{reference.wolfram_2025_realdigits, author="Wolfram Research", title="{RealDigits}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/RealDigits.html}", note=[Accessed: 01-March-2026]}

BibLaTeX

@online{reference.wolfram_2025_realdigits, organization={Wolfram Research}, title={RealDigits}, year={2007}, url={https://reference.wolfram.com/language/ref/RealDigits.html}, note=[Accessed: 01-March-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English