Converts a number represented in one base (2 to 36) to its representation in another base.
Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.
Try it
Inputs
value (string, required) : The number to convert, as digits/letters valid in from_base.
from_base (integer, required) min 2 max 36 : Base of the input value.
to_base (integer, required) min 2 max 36 : Base to convert the value into.
Outputs
result: value represented in to_base, using digits 0-9 then letters A-Z for digits above 9.
Steps
Positional notation: a number in base b is a sum of digit_i * b^i, where digits range from 0 to b-1 and digits above 9 are written as letters A (10) through Z (35).
Parse value as an integer in from_base to get its numeric value.
Re-express that numeric value in to_base, most significant digit first, using the same digit/letter convention.
Digits/letters in the output are uppercase.
Constants
None.
Sources
The Art of Computer Programming, Vol. 2 (positional number systems) (Addison-Wesley, 2026-09-30T20:00:00Z) - Standard reference for positional notation and base conversion.