Base62 Encode/Decode (Binary)

100% client-side processing (no server upload). Encode binary files/bytes to Base62 text with selectable alphabets, optional line wrapping and line-by-line processing, plus strict validation and data: URI support when decoding back to bytes.

Loading…

About Base62 Encode/Decode (Binary)

Use this tool to encode binary files (bytes) into Base62 text for transport in systems that prefer alphanumeric payloads. While this page is optimized for encoding intent, it also includes a decode action to convert Base62 back into a downloadable binary file. Everything runs locally in your browser (no upload), and you can control the Base62 alphabet, optional wrapping, separators, and validation strictness to match your producer/consumer.

Features

  • Upload/drag-and-drop binary files (.bin, .dat, archives) with multi-file batch support
  • Two actions: Encode (binary β†’ Base62 text) and Decode (Base62 text β†’ downloadable file)
  • Alphabet selection: 0-9A-Za-z (common), 0-9a-zA-Z, A-Za-z0-9, a-zA-Z0-9
  • Optional line wrapping (encode mode): wrap at a chosen column width or disable (0)
  • Choose line separator: LF ( ) or CRLF ( ) for wrapped output
  • Process line by line for multi-record payloads (useful when each line is a separate Base62 chunk)
  • Decode can accept a data:*;base62, prefix (toggleable)
  • Strict validation toggle to reject invalid characters for the selected alphabet
  • Live preview mode for small inputs (disable for large payloads)
  • 100% client-side processing (no server upload).

How to use for base62-binary-encoder

1

Drop a file (or paste Base62 text)

For encoding, drag-and-drop one or more binary files into the dropzone. For decoding, paste the Base62 text you received (optionally with a data:*;base62, prefix if enabled).

2

Choose the action/mode and run it

Select "Action" (Encode or Decode), then click the matching button. For encoding, pick the "Alphabet" you need and optionally set "Wrap lines at" and the line separator. For decoding, enable "Strict validation" to catch invalid characters early, and toggle "Accept data:*;base62, prefix" if your input includes it.

3

Copy output or download the decoded file

After encoding, copy the Base62 text output (wrapped and separated as configured). After decoding, download the reconstructed binary file (filename rules typically strip .b62 when present and fall back to .bin when needed).

Technical specifications

Execution Model

Runtime disclosure, constraints, and data handling.

AspectDetail
Mode100% client-side processing (no server upload).
Action scopeEncode binary β†’ Base62 text (primary), plus Decode Base62 β†’ binary download
InputsEncode: File/Blob/Uint8Array/ArrayBuffer/TypedArray. Decode: Base62 string (optionally data:*;base62, prefix)
OutputsEncode: Base62 text. Decode: bytes as a downloadable file
Limits~1–2MB chars; ~25000 ms timeout
RetentionAll processing happens locally in your browser (no upload)
For sensitive data (secrets, private files), prefer offline/local tooling and avoid sharing payloads via clipboard or screenshots.

Mini Example

A tiny byte sequence encoded using the common alphabet "0-9A-Za-z". Output varies by alphabet and wrapping settings.

ItemValue
Input bytes (hex)00 01 02 03 04 05 06 07 08 09
Output (Base62)(depends on implementation/alphabet)
What changes outputAlphabet order, optional wrapping, line separator, and whether you encode as a single blob or line-by-line chunks
Base62 is not a single universal standard like RFC 4648 Base64. Always keep the alphabet consistent between encoder and decoder.

Errors & Edge Cases

Common failure modes and how to fix them.

SymptomLikely causeWhat to check
Input must be a string for decodeYou attempted to decode but provided bytes/file instead of Base62 textSet Action to Decode and paste Base62 text; use Encode for uploaded files
This tool encodes binary data... not a text stringYou tried to encode by pasting text into the binary encoderUpload a file (or pass bytes). If you need text→bytes conversion, use a text-oriented tool first
Strict validation error / invalid charactersInput contains characters not present in the selected Base62 alphabet (or contains separators/prefixes)Select the correct Alphabet, disable Strict to test lenient inputs, and remove extra whitespace; if input has a data:*;base62, prefix, enable Accept data URI
Decoded file looks corruptedAlphabet mismatch or producer used a different Base62 variantVerify alphabet order with the producer (0-9A-Za-z vs 0-9a-zA-Z etc.) and keep it identical on both sides
Unexpected newlines or chunk boundariesInput/output is wrapped or you used line-by-line processing incorrectlyFor a single payload, set Wrap lines at 0 and keep lineByLine off; for multi-record streams, enable lineByLine and ensure one Base62 chunk per line
Input too large (max 2MB) / timed outPayload exceeds safe limits or device is slowSplit the payload, disable Live preview, or switch to a local script/tool for large files

Options & Output Rules

How UI options influence encoding/decoding behavior.

OptionApplies toEffect
ActionEncode / DecodeEncode turns bytes into Base62 text; Decode turns Base62 text into a downloadable binary file.
AlphabetEncode / DecodeDefines the 62-character set order. Must match between systems for correct decoding.
Wrap lines atEncode onlyIf > 0, inserts line breaks at the chosen width; 0 disables wrapping.
Line separatorEncode / Decode (formatting)Controls which newline sequence is used when wrapping or emitting line-based output: LF or CRLF.
Live previewBothAuto-runs on changes (best for small inputs). Disable for large payloads to avoid timeouts.
Process line by lineBothTreats each line as a separate record. Useful for lists/streams of Base62 chunks.
Accept data:*;base62, prefixDecode onlyAllows inputs that start with a data URI-like prefix so the tool can strip it before decoding.
Strict validationDecode onlyRejects characters outside the selected alphabet and catches malformed inputs early.
If you don't control the producer, start by identifying which alphabet it uses, then lock that choice everywhere (docs, CI, and code).

Command line alternatives

There is no universal Base62 CLI in most operating systems. For reproducible results in CI or for large files, use a maintained library and explicitly document the alphabet mapping used by your system.

All platforms (Python)

Encode/decode Base62 using a maintained library (pin version + alphabet)

python -c "import sys; print('Base62 is not in the Python stdlib. Use a maintained Base62 library, pin its version, and explicitly configure the alphabet (e.g., 0-9A-Za-z vs 0-9a-zA-Z).')"

Python's standard library does not include Base62. For correctness and reproducibility, use a reputable library, pin the dependency version, and keep the alphabet consistent across services.

Node.js

Encode/decode Base62 using a maintained library (document alphabet)

node -e "console.error('Base62 is not built into Node core. Use a reputable Base62 library, pin its version, and document/configure the alphabet (0-9A-Za-z, 0-9a-zA-Z, etc.) to avoid mismatches.')"

Node does not ship a Base62 codec in core. Prefer a reputable library and write down the alphabet choice so encode/decode remain compatible over time.

Use cases

Embed binary artifacts into text-only channels

  • Attach small binaries inside JSON, YAML, or environment-driven systems that prefer alphanumeric payloads
  • Share test fixtures as Base62 text when raw bytes aren't convenient
  • Store compact-ish identifiers or payloads without punctuation-heavy alphabets

Interoperability testing across alphabets

  • Compare outputs across different alphabet orders to understand compatibility constraints
  • Teach the difference between Base64 (standardized) and Base62 (variant-driven)
  • Demonstrate why strict validation and explicit alphabets matter

CI sanity checks for small artifacts

  • Validate that produced Base62 decodes back to bytes successfully (round-trip checks)
  • Enforce a single alphabet choice across repositories keeps builds reproducible
  • Normalize wrapping/separators so diffs stay stable

Reduce ambiguity and decoding risks

  • Enable Strict validation to reject unexpected characters early
  • Avoid copying secrets into browser tools; use local scripts for sensitive data
  • Document and lock alphabet choices to prevent accidental cross-system corruption

❓ Frequently Asked Questions

Is there a public API for this tool?

No. This is an in-browser tool and does not expose a public API endpoint.

Is processing local or remote?

100% client-side processing (no server upload). All encoding/decoding happens locally in your browser.

Can I safely encode secrets or sensitive files here?

Avoid it. Even with local processing, secrets can leak via clipboard history, screenshots, extensions, or shared machines. For sensitive material, prefer local/offline tooling.

Why does decoding fail with a validation/parse error?

Most failures come from an alphabet mismatch, unexpected prefixes (like data:*;base62,), whitespace/newlines, or non-Base62 characters. Select the correct "Alphabet", enable "Accept data:*;base62, prefix" if applicable, and use "Strict validation" to pinpoint invalid characters.

Why is my decoded file corrupted even though decoding succeeds?

Base62 variants differ by alphabet order. If the producer used a different alphabet (for example 0-9a-zA-Z instead of 0-9A-Za-z), decoding may yield bytes but not the original content. Verify the producer's alphabet and keep it identical in every encoder/decoder.

Pro Tips

Best Practice

Treat Base62 as variant-driven: always record the alphabet (0-9A-Za-z vs 0-9a-zA-Z etc.) alongside the payload.

Performance Tip

For stable outputs, keep wrapping disabled (wrapLineLength=0) unless you have a transport layer that requires fixed-width lines.

Security Tip

Enable Strict validation when debugging: it catches stray whitespace, wrong characters, and alphabet mismatches early.

CI Tip

In CI, add a round-trip test (encode β†’ decode) on representative fixtures and pin your Base62 library version.

Additional Resources

Other Tools