Skip to content

Main content

Encoding: Base32 Pad Character Count Tool

Compute RFC4648 padded Base32 length and padding count from byte length, independently of the base32/base32hex alphabet.

Loading tool…

Description

padCharacters is [0,6,4,3,1][byteCount modulo 5]; encodedLength = 8*ceil(byteCount/5).

A positional encoding separates numeric digit values, alphabet symbols and final-block padding. An alphabet lookup is not a whole-stream codec, and character count can differ from the number of source bytes represented.

padCharacters is [0,6,4,3,1][byteCount modulo 5]; encodedLength = 8*ceil(byteCount/5).

When to use this tool

Use Encoding: Base32 Pad Character Count when checking one alphabet mapping or bounded encoding-padding term.

How to use the tool and how it works

  1. Enter byteCount. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Require whole byteCount in [0,1000000000]. padCharacters is [0,6,4,3,1][byteCount modulo 5]; encodedLength = 8*ceil(byteCount/5).1

Alphabet, tail pad bits and written padding depend on the selected base encoding. This tool handles only its stated local component.2

Input fieldMeaning and unitsAccepted input
byteCountByte CountRequired. Safe integer.
Output fieldInterpretationReturned shape
resultObject containing the named calculated members below.Required. Object.
result.padCharactersPad CharactersCalculated result member: number.
result.encodedLengthEncoded LengthCalculated result member: number.
json
{
  "input": {
    "byteCount": 2
  },
  "output": {
    "result": {
      "padCharacters": 4,
      "encodedLength": 8
    }
  }
}

Limitations and assumptions

  • This assumes padded Base32 without whitespace. It does not measure Unicode text, choose an alphabet or validate an encoded payload.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use the complete codec matching the intended alphabet and padding policy for real payloads and interoperability checks.

References

  1. Calculation and input contract: encode/base32-pad-character-count — tool.io

  2. Base16, Base32 and Base64: RFC 4648 — Internet Engineering Task Force

Similar or alternative tools