Tool for decoding or encoding with Base 92. Base 92 code allows binary information to be stored in ASCII format with minimal data loss.
Base 92 Encoding - dCode
Tag(s) : Character Encoding
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!
The 92 character alphabet used in Base 92 is indexed as follows:
(empty) | ~ | 9 | + | 19 | 5 | 29 | ? | 39 | I | 49 | S | 59 | ] | 69 | h | 79 | r | 89 | | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | ! | 10 | , | 20 | 6 | 30 | @ | 40 | J | 50 | T | 60 | ^ | 70 | i | 80 | s | 90 | } |
1 | # | 11 | - | 21 | 7 | 31 | A | 41 | K | 51 | U | 61 | _ | 71 | j | 81 | t | ||
2 | $ | 12 | . | 22 | 8 | 32 | B | 42 | L | 52 | V | 62 | a | 72 | k | 82 | u | ||
3 | % | 13 | / | 23 | 9 | 33 | C | 43 | M | 53 | W | 63 | b | 73 | l | 83 | v | ||
4 | & | 14 | 0 | 24 | : | 34 | D | 44 | N | 54 | X | 64 | c | 74 | m | 84 | w | ||
5 | ' | 15 | 1 | 25 | ; | 35 | E | 45 | O | 55 | Y | 65 | d | 75 | n | 85 | x | ||
6 | ( | 16 | 2 | 26 | < | 36 | F | 46 | P | 56 | Z | 66 | e | 76 | o | 86 | y | ||
7 | ) | 17 | 3 | 27 | = | 37 | G | 47 | Q | 57 | [ | 67 | f | 77 | p | 87 | z | ||
8 | * | 18 | 4 | 28 | > | 38 | H | 48 | R | 58 | \ | 68 | g | 78 | q | 88 | { |
In practice, only 91 signs are used in basic calculations, the 92nd (the tilde ~) is only used to indicate an empty string.
To encode data in Base 92, cut the data into 13-bit blocks to make 2 base 91 characters (yes 91 and not 92).
Example: dCode is written in binary (ASCII) 0110010001000011011011110110010001100101
Blocking of 13 bits gives 0110010001000,0110110111101,1001000110010,1
The converting 0110010001000 (base 2) gives ' 3208' (base 10) or 35×91+23. Character 35 of base 91 is E and character 23 is 9 whose block is coded E9.
Complete the last block with 0 on the right. Pad to 6 bits if the block contained 6 bits or less, otherwise pad to 13 bits.
Example: The last block 1 (length 1 bit) is completed to 100000 (completed over 6 bits) or 32 in base 10, and symbol 32 is B.
The complete coded message is E9H]U3B
For each pair of characters, note the value of each symbol in the Base 92 alphabet. Multiply the first by 91 and add them.
Example: Decode 9A2?VBWl by splitting it into pairs 9A 2? VB Wl. The first character 9 has the index 23, and A the code 31. The calculation is 23×91+31=2124.
For each number obtained, convert it to binary, completing it if necessary on the left to obtain 13 bits.
Example: 2124 in base 10 corresponds to 100001001100 in binary, as this number is only 12 bits, add an initial zero or 0100001001100
The binary sequence obtained (by concatenation of 13-bit numbers) corresponds to the plain message. If the message was originally encoded in 8-bit ASCII, then each byte corresponds to an ASCII character.
Example: The binary sequence is 01000010,01100001,01110011,01100101,00111001,00110010 or the 6 Base92 characters
The message is composed of the 91 characters of the Base92 alphabet.
The character ~ appears alone or does not appear.
If the message length is odd, then the last character can only be among the first 64 characters of the alphabet.
Each 13-bit block can encode 2^13 = 8192 values, while 2 base 91 characters encode 91^2=8281 values. The encoding loss is therefore minimized for an alphabet of 91 symbols.
dCode retains ownership of the "Base 92 Encoding" source code. Except explicit open source licence (indicated Creative Commons / free), the "Base 92 Encoding" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Base 92 Encoding" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Base 92 Encoding" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Base 92 Encoding" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Base 92 Encoding on dCode.fr [online website], retrieved on 2024-12-03,