Base85 RFC 1924 Encoder

Enter a non-negative whole number to encode.

How it is calculated

The tool writes a non-negative whole number in base 85 using the RFC 1924 digit set. Digit values 0 to 84 map to 0-9, A-Z, a-z and then the 23 symbols !#$%&()*+-;<=>?@^_`{|}~. The number is divided by 85 again and again; each remainder is one digit, and the digits read in reverse order of calculation give the result: n = dk·85k + … + d1·85 + d0.

Only plain digits 0 to 9 are accepted, with no sign, decimal point, comma or exponent, so 1,000 and 1e6 return nothing. Leading zeros are ignored, and zero encodes to the single character 0. The input can be larger than 64 bits, since the division is done on the decimal string. The tool encodes a number, not text or raw bytes, and shows the length of the result in characters.

Worked example

Encode 12,345,678, entered as 12345678. Divide by 85 repeatedly: 12345678 = 145243 × 85 + 23; 145243 = 1708 × 85 + 63; 1708 = 20 × 85 + 8; and 20 is below 85. The remainders from last to first are 20, 8, 63, 23. In the RFC 1924 alphabet 20 is K, 8 is 8, 63 is # and 23 is N. The tool prints K8#N, 4 characters long. The 8-digit decimal number fits in four base-85 characters.

Try this example →

Common mistakes

  • Typing the number with thousands separators (12,345,678) or a decimal point. Only digits are accepted.
  • Entering text such as a name or an IPv6 address. The tool converts a single integer, so an IPv6 address must be converted to its 128-bit integer first.
  • Confusing this with Ascii85. RFC 1924 uses a different alphabet and encodes the whole number as one value, not in 4-byte groups.
  • Expecting the output to be decodable without the alphabet. The same characters mean different values in other Base85 variants.
  • Entering a negative number or one in scientific notation, such as 1e6. Both return no result.

About this calculator

Base85 encoding represents data using 85 printable characters instead of Base64's 64, packing more information per character: the same number comes out roughly 6% shorter than in Base64. RFC 1924 defines a specific Base85 alphabet (0–9, A–Z, a–z plus a set of punctuation symbols) originally proposed as a compact textual notation for IPv6 addresses. This encoder takes a non-negative whole number written in ordinary decimal digits and converts it to that alphabet through repeated division by 85, the same technique used to convert a number into any base. It encodes a single integer, not raw bytes or text.

While RFC 1924's IPv6 notation itself never saw wide adoption, its Base85 alphabet and encoding method remain useful in software engineering wherever a compact text representation of a number is needed — such as writing large numeric IDs more densely than Base64 allows. Developers working with base-conversion and encoding schemes use tools like this to verify their own RFC 1924 implementation or convert values by hand for debugging.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    RFC 1924 was written for IPv6, where a full 128-bit address becomes exactly 20 characters. You can test that here: the largest 128-bit integer, 340282366920938463463374607431768211455, encodes to 20 characters. This tool takes decimal digits only and does not parse IPv6 text, so convert the address to its integer value first. Small values give shorter results with no padding. Which direction would be more useful to you, decoding back to a number or an IPv6 address input?

Popular calculators

All Calculators