dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day! A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!

To add leading zeros à des nombres, enter the numbers in the textarea and either the quantity of 0s to add or the desired length of digits for the number and dCode will calculate the required number of zeros. This operation is sometimes called zfill.

Example:123 formatted for a length of 8 gives 00000123

Example:123 formatted with 5 initial zeros also gives 00000123

How to remove zeros to the left?

To deformat a number and remove zeroes at the start, enter the numbers the field and all leading zeros will be removed.

Example:000123 will be converted to 123

Example:0.123 stays unchanged as 0.123

To convert 00000123 to 000123 then, first remove the 0s and then pad left 3 zeros.

Source code

dCode retains ownership of the online 'Leading Zeros' tool source code. Except explicit open source licence (indicated CC / Creative Commons / free), any 'Leading Zeros' algorithm, applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any 'Leading Zeros' function (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and no data download, script, copy-paste, or API access for 'Leading Zeros' will be for free, same for offline use on PC, tablet, iPhone or Android ! dCode is free and online.

Need Help ?

Please, check our dCode Discord community for help requests! NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Thanks to your feedback and relevant comments, dCode has developed the best 'Leading Zeros' tool, so feel free to write! Thank you!

Thanks to your feedback and relevant comments, dCode has developed the best 'Leading Zeros' tool, so feel free to write! Thank you!