Skip to content

Main content

Decoding: Base64 Final Quartet Pad Bits Check Tool

Check RFC4648 Base64 final-quartet padding shape and unused pad bits under required four-symbol padding, without decoding an entire stream.

Loading tool…

Description

Check canonical pad bits in one standard Base64 quartet.

Encoded representations separate alphabet symbols, numerical digit values, byte grouping and tail padding. Recognizing one symbol or pad-bit pattern is not full payload decoding, and different alphabet variants can assign different values.

Check canonical pad bits in one standard Base64 quartet.

When to use this tool

Use Decoding: Base64 Final Quartet Pad Bits Check when inspecting one stated alphabet, group or padding component.

How to use the tool and how it works

  1. Enter quartet. 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.

Check canonical pad bits in one standard Base64 quartet. Require its local four-character alphabet/padding pattern; count trailing equals, inspect low four or two bits accordingly and return decodedByteCount = 3-pads.1

Canonical Base-N encodings require unused pad bits to be zero; alphabet membership alone does not establish canonical encoding.2

Input fieldMeaning and unitsAccepted input
quartetQuartetRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultReturned object; expand its named members below.Required. Object.
result.padCharactersPad CharactersCalculated result member: number.
result.canonicalPadBitsUnused bits are zero; this does not decode a complete Base64 stream.Calculated result member: boolean.
result.decodedByteCountDecoded Byte CountCalculated result member: number.
json
{
  "input": {
    "quartet": "Zh=="
  },
  "output": {
    "result": {
      "padCharacters": 2,
      "canonicalPadBits": false,
      "decodedByteCount": 1
    }
  }
}

Limitations and assumptions

  • A false canonical flag is a successful result; line handling, URL alphabet and complete streams are outside scope.
  • 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.

Alternative or Complementary methods

Use the complete codec matching the required alphabet and canonicality rules for real encoded data.

References

  1. Calculation and input contract: decode/base64-final-quartet-pad-bits-check — tool.io

  2. RFC 4648: Base-N encodings — RFC Editor

Similar or alternative tools