Why is Base62 commonly used for short URL codes instead of Base64?

6 year of experience System Design URL Shortener Bitly URL Shortener Bitly Medium Single Correct Pyq Inspired

Question

Why is Base62 commonly used for short URL codes instead of Base64?

A
Because Base62 is URL-friendly and avoids problematic characters like '/' and '+'
B
Because Base62 always provides more combinations than Base64
C
Because Base62 uses only numbers
D
Because Base62 makes database indexing unnecessary

Explanation

Base62 avoids URL-problematic characters like slash and plus.

Base62 uses digits, lowercase letters, and uppercase letters. It avoids characters like '/' and '+', which can cause issues in URLs because slash is a path separator and plus can be interpreted specially in query strings. This makes Base62 compact and URL-friendly.

Related Questions

Where should a URL shortener cache frequently accessed short_code to long_url mappings for...

URL Shortener Bitly

View Question

Why should a URL shortener maintain an index or primary key on the short_code column?

URL Shortener Bitly

View Question

A short URL has expired. What should the redirect service ideally return when the short co...

URL Shortener Bitly

View Question

Which short-code generation strategy best guarantees uniqueness without collision checks f...

URL Shortener Bitly

View Question

Why is using the first few characters of the long URL as the short code a bad approach?

URL Shortener Bitly

View Question

Which database constraint is most important for preventing two different long URLs from ge...

URL Shortener Bitly

View Question

Related Resources

Related learning resources will appear as content grows.