Base36 Shortener for IDs

Generate short, URL-friendly identifiers using Base36 encoding

Base36 ID Generator

Convert numbers and text to compact Base36 identifiers

Length: 9 characters
Length: 0 characters

Base36 Alphabet & Examples

Base36 Characters (36 total)

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

Digits 0-9 and letters A-Z (case-insensitive)

Number Examples
1000 → RS
12345 → 9IX
999999 → LFLS
With Prefix
1000 → IDRS
12345 → ID9IX
999999 → IDLFLS
Benefits
• Shorter than decimal
• URL-friendly
• Case-insensitive
• Human-readable

Batch Processing

Convert multiple values at once (one per line)

About Base36 Shortening

  • Base36 uses digits 0-9 and letters A-Z for compact representation
  • Perfect for generating short, URL-friendly identifiers
  • Case-insensitive encoding makes it user-friendly
  • Commonly used for short URLs, session IDs, and database keys
  • More compact than decimal numbers while remaining readable

Understanding Base36 Shortening

Base36 shortening is a technique used to convert long numeric identifiers or text into compact, URL-friendly strings using a 36-character alphabet consisting of digits 0-9 and letters A-Z. This encoding method is particularly valuable for creating short URLs, generating user-friendly reference numbers, and producing compact database keys. Unlike other encoding schemes, Base36 strikes an optimal balance between compactness and readability, making it ideal for applications where both human interaction and system efficiency are important.

How Base36 Encoding Works

Encoding Process

  1. Input Processing: Convert the input number to its decimal representation
  2. Base Conversion: Repeatedly divide by 36, collecting remainders
  3. Character Mapping: Map remainders to the Base36 alphabet (0-9, A-Z)
  4. Result Assembly: Concatenate mapped characters in reverse order
  5. Prefix Addition: Optionally add prefixes for categorization

Number to Base36 Example

Converting 123456 to Base36:

123456 ÷ 36 = 3429 remainder 0 → ‘0’

3429 ÷ 36 = 95 remainder 9 → ‘9’

95 ÷ 36 = 2 remainder 23 → ‘N’

2 ÷ 36 = 0 remainder 2 → ‘2’

Result: 2N90

Compression Comparison

Number:123456
Base36:2N90
Compression:33% shorter
With prefix:ID2N90

Base36 Character Set

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
Digits (0-9)

Values 0-9 represent themselves

Letters (A-Z)

A=10, B=11, ..., Z=35

Case Insensitive

A=a, B=b, etc. (typically uppercase)

Applications and Use Cases

URL Shortening

  • • Short link generation (bit.ly style)
  • • Social media sharing
  • • Email-friendly URLs
  • • QR code optimization
  • • Analytics tracking codes
  • • Campaign identifiers

Database Systems

  • • Primary key generation
  • • Foreign key references
  • • Sharded database IDs
  • • Index optimization
  • • Partition keys
  • • Cache keys

User-Facing IDs

  • • Order numbers
  • • Invoice references
  • • Ticket numbers
  • • Customer IDs
  • • Product codes
  • • Transaction IDs

Session Management

  • • Session tokens
  • • Temporary identifiers
  • • Authentication codes
  • • Reset tokens
  • • Verification codes
  • • API keys

Content Management

  • • Document IDs
  • • Media file references
  • • Version identifiers
  • • Slug generation
  • • Permalink creation
  • • Category codes

Gaming & Apps

  • • Player IDs
  • • Game room codes
  • • Achievement IDs
  • • Leaderboard entries
  • • Match identifiers
  • • Item codes

Advantages of Base36 Encoding

Technical Benefits

Space Efficiency

Reduces identifier length by approximately 30-40% compared to decimal representation

URL Compatibility

All characters are URL-safe without requiring percent encoding

Case Insensitive

Reduces user input errors and improves accessibility

User Experience Benefits

Human Readable

Uses familiar alphanumeric characters that are easy to read and type

Voice Friendly

Can be communicated verbally using NATO phonetic alphabet

Print Friendly

Works well in printed materials, business cards, and documents

Implementation Strategies

ID Generation Patterns

Sequential IDs
1 → 1
100 → 2S
1000 → RS
10000 → 7PS

Predictable, ordered, good for debugging

Timestamp-based IDs
1640995200 → QO6G00
1640995260 → QO6G1K
1640995320 → QO6G2Y

Time-ordered, sortable, collision-resistant

Prefix Strategies

Type-based: USR, ORD, INV
Environment: DEV, STG, PROD
System: API, WEB, MOB
Year: 23, 24, 25

Padding Techniques

Fixed length: 000001, 00001A
Minimum length: 6 characters
Zero padding: Left-padded with zeros
Consistent format: Better UX

Collision Avoidance

Timestamps: Millisecond precision
Random suffix: Add entropy
Node ID: Multi-server support
Check digits: Error detection

Performance and Scalability

Performance Metrics

Encoding Speed:O(log n) complexity
Memory Usage:Minimal (constant space)
Compression Ratio:~30-40% reduction
URL Length:Significant savings

Scalability Factors

ID Space

36^6 = 2.1 billion unique 6-character IDs

Database Indexing

Shorter keys improve index performance

Network Efficiency

Reduced bandwidth usage for API calls

Base36 vs Other Encoding Systems

SystemCharactersCase SensitiveURL SafeEfficiencyUse Case
Base360-9, A-ZNoYesGoodShort URLs, IDs
Base620-9, A-Z, a-zYesYesBetterVery short URLs
Base64A-Z, a-z, 0-9, +, /YesNo (+, /)BestData encoding
Hexadecimal0-9, A-FNoYesPoorTechnical data

Best Practices and Guidelines

Design Considerations

ID Structure
  • • Use consistent prefix conventions
  • • Implement minimum length requirements
  • • Consider chronological ordering
  • • Plan for future growth
User Experience
  • • Make IDs copy-pasteable
  • • Avoid confusing character combinations
  • • Provide clear formatting guidelines
  • • Support case-insensitive input

Security Considerations

  • • Avoid sequential IDs for sensitive data
  • • Add randomness to prevent enumeration
  • • Use check digits for critical applications
  • • Implement rate limiting for ID generation
  • • Consider cryptographic randomness sources

Implementation Tips

  • • Cache frequently used conversions
  • • Validate input before processing
  • • Handle edge cases (zero, negative numbers)
  • • Document ID format specifications
  • • Test with large number ranges

Related Encoding Tools