# Convert number to list [closed]

FromDigits will convert a list to a number, i.e.

FromDigits[{5, 1, 2, 8}]
> 5128


Now, I want to convert 5128 back to a list, e.g {5,1,2,8}

How do I do that (particularly with a 5000 character long integer)?

• Always have a look at the "See Also" section in the footer of the documenation of a built-in symbol. In this case, IntegegerDigits is the first entry in that section. – Henrik Schumacher Dec 18 '18 at 12:01
• Sorry, "FromDigits is effectively the inverse of IntegerDigits and IntegerString." is literally the first line in Details section. – Kuba Dec 18 '18 at 12:03

The command IntegerDigits do the job
IntegerDigits[5128]
{5, 1, 2, 8}