Base62 Encoder + Decoder (URL Shorteners)

Base62 uses digits + lowercase + uppercase = 62 characters. URL shorteners (bit.ly, YouTube video IDs) use it to produce compact, URL-safe IDs. This tool encodes integers to base62 and decodes them back.

How to use the Base62 Encoder + Decoder (URL Shorteners)

Pick a direction. Encoding: enter a positive integer (BigInt supported). Decoding: enter a base62 string.

Base62 for compact numeric IDs

Base62 represents a number using 62 symbols: the digits 0–9, lower-case a–z, and upper-case A–Z. Because it is purely alphanumeric, the output drops cleanly into URLs, filenames, and hostnames with no escaping. URL shorteners like Bitly and the eleven-character IDs in YouTube links use exactly this idea to turn a database row number into a short, opaque code.

This converter works on integers — give it a positive number and it returns the base62 string, or paste a base62 string to read the number back. It handles very large values via BigInt, so an ID well beyond 64 bits still converts exactly. If you specifically want to shorten 128-bit UUIDs, the UUID to Base62 tool is purpose-built for that.

Common use cases

  • Building a URL shortener — map an auto-incrementing ID to a short base62 slug.
  • Opaque public IDs — expose a compact code instead of a raw sequential database key.
  • Decoding short links — recover the numeric ID a base62 code stands for.
  • Shorter references — turn a large counter into a few alphanumeric characters.
  • Learning positional bases — see how a number looks when written in base 62.

Frequently asked questions

What is the difference between this and the UUID to Base62 tool?

This one converts arbitrary integers to and from base62. The UUID tool is specialized for 128-bit UUIDs, always producing a 22-character string. Use this for counters and IDs, that one for UUIDs.

Can it handle numbers larger than 64 bits?

Yes. It uses BigInt arithmetic, so arbitrarily large integers convert exactly without overflow or rounding.

Why use base62 instead of hexadecimal for IDs?

Base62 packs more value into each character (62 symbols versus 16), so the same number becomes a noticeably shorter string — useful when the ID appears in a URL.

Is base62 ordering preserved?

With fixed-width, left-padded encoding, base62 strings sort in the same order as the numbers. Variable-length output does not sort numerically, so pad to a fixed width if lexical order matters.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: