Cipher Decipher

Encoding & Decoding

Base62 Encode/Decode

URL-safe encoding using alphanumeric characters for web applications and APIs.

Share this tool

Cipher DecipherCipher Decipher
Plain text Tool
Base62 encoding using 0-9, A-Z, a-z characters for URL-safe compact representation.

Share this tool

Help others discover this plain text tool

Embed Base62 Encode/Decode
Customize and generate embed code for your website or application

Customization

Preview

Cipher Decipher
Base62 Encode/Decode
Tool preview area

Embed Code

Related Tools

Discover similar tools

Base58 Encode / Decode
Same category - highly relevant
Bitcoin and cryptocurrency encoding that avoids ambiguous characters for better readability.
encoding-decodingTry Tool
URL Encoder/Decoder
Same category - highly relevant
Encode URLs for safe web use and decode URL-encoded strings back to original format.
encoding-decodingTry Tool
HTML Entity Encoder/Decoder
Same category - highly relevant
Convert characters to HTML entities for safe display and decode entities back to text.
encoding-decodingTry Tool
Base32 Encode / Decode
Same category - highly relevant
Encode text to Base32 or decode Base32 payloads for safer encoding in various systems.
encoding-decodingTry Tool
Binary to Text Converter
Same category - highly relevant
Turn plain text into 8-bit binary bytes and convert binary strings back to text.
encoding-decodingTry Tool
Base85 Encode/Decode
Same category - highly relevant
RFC 1924 efficient binary-to-text encoding using 85 printable ASCII characters.
encoding-decodingTry Tool

Introduction

Need to generate short, URL-safe identifiers that won't break your routing or require ugly percent-encoding? Base62 encoding maps binary data into exactly 62 alphanumeric characters (0-9, A-Z, a-z), dodging the problematic symbols found in Base64. It is the industry standard for URL shorteners, pastebins, and API tokens where maximum compatibility is strictly required. Paste your text or binary payload below to instantly encode or decode Base62 strings right in your browser, with zero data sent to external servers.

What this tool does

  • Converts binary or UTF-8 text to a compact Base62 alphanumeric string.
  • Uses a strict 62-character alphabet (\\`0\-9\\`, \\`\A-Z\\`, \`a-z\`) ensuring perfect URL safety.
  • Decodes Base62 strings back into readable text or binary formats.
  • Automatically strips invalid characters during the decoding process.
  • Updates the output instantly in the browser without backend API calls.

How this tool works

When you input text, the tool first encodes your string into a UTF-8 byte array. Instead of processing the data in fixed 6-bit chunks like Base64, it treats the entire byte sequence as one massive integer.

It then repeatedly divides this large integer by 62, mapping the remainders to the Base62 alphabet array. The interface handles the complex BigInt mathematical conversions instantly as you type.

For decoding, it reverses the process: multiplying the parsed Base62 characters back into a massive integer and converting it down into a raw byte array before decoding it back to a UTF-8 string. The tool ensures edge cases, like leading zero-bytes, are handled seamlessly to prevent data corruption.

How the cipher or encoding works

Base62 is a positional numeral system. Unlike Base64—which is formalized in RFC 4648 and relies on 64 characters (including `+` and `/`)—Base62 uses exactly 62 characters. This intentional constraint avoids characters that have special semantic meaning in HTTP URLs or database queries.

Because 62 is not a power of 2, Base62 encoding cannot be performed using simple bitwise shifts. Instead, the input must be processed using arbitrary-precision arithmetic (BigInt division). This makes it computationally heavier than Base64, but guarantees that the resulting string requires zero URL-encoding (e.g., no converting `+` to `%2B`).

The most common alphabet for Base62, popularized by systems like GMP (GNU Multiple Precision Arithmetic Library), is `0-9A-Za-z`. However, variants like the inverted `A-Za-z0-9` are also used depending on the implementation. Its primary advantage is yielding an encoded payload that is approximately 73% the size of hex encoding, while remaining entirely alphanumeric.

How to use this tool

  1. Type or paste your payload into the primary input field.
  2. Select Encode if converting raw text to Base62, or Decode if converting Base62 back to readable text.
  3. If your payload contains invalid characters during decoding (like spaces or punctuation), the tool will ignore or strip them automatically.
  4. Use the Copy button to grab the exact output for your configuration file, URL router, or database.

Real-world examples

Building a URL Shortener

A developer needs to convert a database row ID into a short link. They pass the integer ID `8399219` into a Base62 encoder. The result is a compact string like `c3pZ`. This string is easily appended to a domain (e.g., `https://ex.co/c3pZ`) without worrying about reserved URL characters breaking the routing logic.

Generating API Keys

An authentication service requires API keys that users can easily copy, paste, and double-click in their terminal without accidentally highlighting trailing punctuation. By encoding a 128-bit random seed into Base62, the system outputs a clean, alphanumeric string like `9BvXf3TzL8aK2pM1qN5wE`.

Decoding Legacy Tokens

A security researcher captures a session token `1a2b3C` from a network log. Knowing it contains no special characters, they suspect Base62. They paste the string into the decoder to reveal the underlying integer or text mapping, confirming it maps to a predictable sequence number.

Comparison with similar methods

MethodComplexityTypical use
Base64LowEmail attachments (MIME), JWTs
Base62MediumURL shorteners, alphanumeric IDs
Hexadecimal (Base16)Very lowCryptographic hashes, simple encoding
Base85 (Ascii85)MediumPDF files, Adobe PostScript

Limitations or considerations

Base62 is strictly an encoding format, not encryption. It provides zero cryptographic security and should not be used to hide sensitive data like passwords or PII.

Additionally, because 62 is not a power of 2, encoding very large files requires significant computational overhead due to the arbitrary-precision integer division required. For massive binary files, Base64 or Base85 is much faster and more efficient. Finally, Base62 is case-sensitive; if a system forces strings to lowercase, the encoded data will be irreparably corrupted.

Frequently asked questions

Related tools

Conclusion

Base62 is an invaluable utility for generating clean, alphanumeric strings that survive URL routing, database indexing, and user copy-pasting. While not suited for massive binary files, it solves specific deployment challenges perfectly. Test your payloads in the tool above, or check out our Base64 converter for larger data streams.