Base62 Encoder / Decoder
Text
Base62
Technical details
How the Base62 Encoder / Decoder Works
What the Tool Does
Base62 encodes binary data using the 62 alphanumeric characters (0-9, A-Z, a-z) and decodes Base62 strings back to text or hex. The output contains only URL-safe characters with no padding, no '+', '/', or '=' symbols, so it can be embedded directly in URLs and query parameters without percent-encoding.
Common Developer Use Cases
URL shorteners (bit.ly, t.co, goo.gl historically) use Base62 to encode incrementing integer IDs into compact, share-friendly slugs. Backend developers generate short opaque identifiers for social posts, tweets, and uploaded assets. Marketers track campaigns using Base62-encoded UTM parameters that look cleaner than Base64.
Data Formats, Types, or Variants
The tool uses the most common Base62 alphabet ordering: digits 0-9, then uppercase A-Z, then lowercase a-z. Different implementations may use different orderings (some put lowercase before uppercase), so always verify alphabet compatibility before sharing encoded data between systems. Output is shown for both UTF-8 text and raw hex byte input.
Common Pitfalls and Edge Cases
Base62 is not standardized — alphabet ordering differs between libraries (this tool uses 0-9, A-Z, a-z, matching the npm `base-x` convention). Leading zero bytes in binary data are preserved by the encoder but a Base62 string that starts with '0' decodes to the same value as one without — there's no canonical form. For interoperability across languages, document the exact alphabet you used.
When to Use This Tool vs Code
Use the browser tool for one-off encoding and decoding while debugging URL slugs or short IDs. In code, prefer the `base-x` npm package (JavaScript), `pybase62` or hand-written conversion (Python), or `Base62.io` Java implementations — and always pin the alphabet in tests so a future refactor doesn't silently change the encoding.