Base64 Validator — Check if String is Valid Base64

Paste a string to validate if it is properly Base64 encoded. Get detailed diagnostics including character set analysis, padding check, and decode test.

What makes a valid Base64 string?

A valid Base64 string contains only characters from the Base64 alphabet: A-Z, a-z, 0-9, + and / (or - and _ for URL-safe variant). The string length must be a multiple of 4 when properly padded with = characters.

Common issues include trailing whitespace, line breaks, or characters outside the Base64 alphabet. This validator checks all these conditions and attempts to decode the string to confirm it produces valid binary data.

Base64 validation rules

  • Only contains Base64 alphabet characters (A-Za-z0-9+/ or -_)
  • Length is a multiple of 4 (with padding) or can be padded to a multiple of 4
  • Padding (=) only appears at the end, maximum 2 characters

Base64 variants

  • Standard (RFC 4648): Uses + and / with = padding
  • URL-safe (RFC 4648 §5): Uses - and _ (safe for URLs and filenames)
  • MIME (RFC 2045): Standard Base64 with line breaks every 76 characters

FAQs

Why does my string fail validation?

Common reasons include: spaces or line breaks in the string, characters outside the Base64 alphabet (like @, #, or !), or incorrect padding. The validator will tell you exactly what's wrong.

Is a string with no padding still valid Base64?

Technically, proper Base64 requires padding to make the length a multiple of 4. However, many implementations accept unpadded strings. This validator considers unpadded strings as 'valid but missing padding.'

What is URL-safe Base64?

URL-safe Base64 replaces + with - and / with _ to avoid conflicts with URL special characters. This variant is commonly used in JWT tokens, data URIs, and filenames.

Related Tools