Skip to content
uencoder

Base62

Base62 represents numbers with 62 characters (0-9, a-z, A-Z); it is case-sensitive, denser than Base36, and widely used for short links and ID generation.

Purpose

It maximizes the radix under an alphanumeric-only constraint (no special characters), producing URL-safe, compact short codes.

Mechanism

A non-negative integer is repeatedly divided by 62; remainders 0-9 map to 0-9, 10-35 to a-z, and 36-61 to A-Z. Decoding expands by positional weight. It applies to integers only.

Use cases

  • Short-link services (bit.ly style)
  • Distributed ID generation (e.g., hashids)
  • Invitation and coupon codes
  • URL-friendly database primary keys

Examples

  • Input
    1234567890
    Output
    1ly7vk

    Decimal to Base62

Common errors

Case sensitivity causing user input errors
Prefer Base36 for human input scenarios, or add a checksum

Related terms

Related tools

References