Base64 Decode reference library

Encoding Formats — Cheat Sheet

Printable Reference
Quick reference for developers.
Base64, URL encoding, HTML entities, JWT structure, and Unicode escapes in one page.

Need the live tools? Use Base64Decode for instant encoding and decoding, or jump straight to the JWT Decoder.


Base64 Encoding

Alphabet

A-Z  (0-25)   a-z  (26-51)   0-9  (52-61)   +  (62)   /  (63)
Padding: =

How It Works

  1. Take 3 bytes (24 bits) of input.
  2. Split them into 4 groups of 6 bits.
  3. Map each 6-bit value to the Base64 alphabet.
  4. If the input is not divisible by 3, pad with =.

Padding Rules

Input bytes mod 3Padding
0 (exact multiple)No padding
1 (1 byte remainder)==
2 (2 byte remainder)=

Size: Output is about 33% larger than the input.

Variants

Variant+ replaced/ replacedPaddingUse Case
Standard (RFC 4648)+/=Email (MIME), PEM
URL-safe (RFC 4648 §5)-_OptionalURLs, filenames, JWT
MIME (RFC 2045)+/=Email, max 76 chars per line

Quick Examples

InputBase64
HelloSGVsbG8=
Hello!SGVsbG8h
AQQ==
ABQUI=
ABCQUJD

URL Encoding (Percent-Encoding)

Rules

Common Encodings

CharacterEncodedNotes
(space)%20 or ++ only in form-encoded data
!%21
#%23Fragment identifier
$%24
%%25Escape the escape character itself
&%26Query parameter separator
+%2B
/%2FPath separator
=%3DKey-value separator
?%3FQuery string start
@%40
é%C3%A9UTF-8 multi-byte sequence
%E2%82%ACUTF-8 3-byte sequence

HTML Entities

Named Entities (Most Common)

CharacterEntityNumeric
<&lt;&#60;
>&gt;&#62;
&&amp;&#38;
"&quot;&#34;
'&apos;&#39;
Space (non-breaking)&nbsp;&#160;
©&copy;&#169;
®&reg;&#174;
&trade;&#8482;
&mdash;&#8212;
&ndash;&#8211;
&euro;&#8364;
£&pound;&#163;
¥&yen;&#165;

Numeric entity formats: &#DDD; for decimal and &#xHHH; for hexadecimal.


JWT (JSON Web Token)

Structure

header.payload.signature
  ↓        ↓        ↓
Base64url  Base64url  Base64url

Header (typical)

{
  "alg": "HS256",
  "typ": "JWT"
}

Common Algorithms

CodeAlgorithmType
HS256HMAC-SHA256Symmetric (shared secret)
HS384HMAC-SHA384Symmetric
HS512HMAC-SHA512Symmetric
RS256RSA-SHA256Asymmetric (public/private key)
RS512RSA-SHA512Asymmetric
ES256ECDSA-SHA256Asymmetric (elliptic curve)
PS256RSA-PSS-SHA256Asymmetric
noneNo signatureNever use in production

Standard Claims

ClaimNameTypeExample
issIssuerstring"auth.example.com"
subSubjectstring"user:12345"
audAudiencestring or array"api.example.com"
expExpirationnumber (epoch)1735689600
nbfNot Beforenumber (epoch)1735603200
iatIssued Atnumber (epoch)1735603200
jtiJWT IDstring"abc-123-def"

Debugging Tips

  1. Open the JWT Decoder and inspect the token parts separately.
  2. Check the exp claim first because many auth failures are just expired tokens.
  3. Verify that aud matches the API or service that is rejecting the token.
  4. Never trust alg: none; always validate the algorithm server-side.

Unicode Escapes

FormatExample (é = U+00E9)Used In
\uXXXX\u00E9JavaScript, JSON
\UXXXXXXXX\U000000E9Python, C
\xHH\xC3\xA9 (UTF-8 bytes)Hex escapes
&#xHH;&#xE9;HTML
%XX%C3%A9URL encoding

Use the live tools: Encode and decode on Base64Decode

More references: Browse all cheat sheets