Skip to content
BetterPass logo

Encoding Detective — Identify Any Encoded String

Paste any string and instantly see which encoding it likely is — Hex, Base64, Base64URL, Base32, Base58, ASCII85, URL percent-encoding, or plain text — ranked by confidence, with a decoded preview.

Detection runs live in your browser. Nothing is uploaded. Whitespace is ignored; a dropped file's text content is analyzed.

Not sure what you have? Paste it above. The detective checks each format's alphabet, length rules, padding, and whether the decode produces readable output — then ranks the candidates.

What is Encoding Detective — Identify Any Encoded String?

The Encoding Detective identifies which encoding an unknown string uses. Paste anything — a hash-looking hex blob, a JWT segment, a TOTP secret, a crypto address, a percent-escaped URL — and get ranked candidates with the reasoning behind each score.

Eight formats — Hex, Base64, Base64URL, Base32, Base58, ASCII85 (Adobe), URL percent-encoding, and plain UTF-8 text.
Transparent scoring — every candidate lists its evidence: charset matches, length divisibility, padding correctness, known shapes (Bitcoin addresses, IPFS CIDs, JWT headers, SHA digest lengths).
Decoded preview — see what each candidate decodes to before committing to a format.
Ranked confidence — formats are ordered by how well the input fits their rules, not by guesswork.

Zero-Server Tool Data Guarantee

All detection and decoding runs locally in your browser using JavaScript only. Your input never leaves your device — no server upload, no logging, no tracking.

How to Use

01

Paste the unknown string

Type, paste, or drop a text file. Analysis updates automatically after a short pause.

02

Read the best guess

The top result has the highest confidence based on alphabet, length, padding, and known-shape checks.

03

Inspect the evidence

Each candidate explains why it scored as it did — charset matches, length rules, padding, or famous prefixes.

04

Check the decoded preview

See what each candidate decodes to. Readable output confirms the match; binary output shows a hex dump.

05

Open the matching tool

Follow the deep link to the full encoder/decoder for the identified format.

Common Use Cases

Identify a mystery string

Found an opaque token in a config file, database row, or log line? Get ranked guesses with evidence in seconds.

Debug JWT fragments

Recognize base64url JWT header segments via the eyJ prefix and preview the decoded JSON claims.

Classify blockchain identifiers

Distinguish legacy Bitcoin addresses, WIF private keys, and IPFS CIDv0 hashes by their Base58 shape.

Recognize hash digests

Spot SHA-1/256/384/512 hex digests by their canonical 40/64/96/128-character lengths.

Recover TOTP secrets

Confirm that an uppercase A–Z2–7 string is RFC 4648 Base32 before feeding it to an authenticator app.

Implementation Examples

JavaScriptCharset & structure checks (no library)
// Quick encoding fingerprint in plain JavaScript
function detectEncoding(input) {
const s = input.trim();
if (/^%[0-9a-fA-F]{2}(%[0-9a-fA-F]{2})*$/.test(s)) return 'url-encoded';
if (/^[0-9a-fA-F]+$/.test(s) && s.length % 2 === 0 && s.length >= 2) {
return 'hex';
}
const b64 = /^[A-Za-z0-9+/]+={0,2}$/.test(s);
if (b64 && s.length % 4 !== 1) return 'base64';
const b64url = /^[A-Za-z0-9_-]+={0,2}$/.test(s);
if (b64url && s.length % 4 !== 1) return 'base64url';
if (/^[A-Z2-7]+=*$/.test(s) && ![1, 3, 6].includes(s.replace(/=/g, '').length % 8)) {
return 'base32';
}
if (/^[1-9A-HJ-NP-Za-km-z]+$/.test(s)) return 'base58 (or a plain word)';
return 'unknown / plain text';
}
console.log(detectEncoding('SGVsbG8=')); // base64
console.log(detectEncoding('48656c6c6f')); // hex
console.log(detectEncoding('JBSWY3DPEHPK3PXP'));// base32

How the detective tells formats apart

FormatStrongest signal
HexEven length, 0–9/A–F only, digest lengths 40/64/96/128
Base64= padding, length divisible by 4, '+'/'/' alphabet
Base64URL'-'/'_' alphabet, unpadded, eyJ prefix for JWTs
Base32Uppercase A–Z/2–7, legal lengths mod 8, '=' to 8-char blocks
Base58No 0/O/I/l, address shapes (1…/3…, Qm…, K/L…)
ASCII85<~ ~> delimiters, chars '!'–'u' only
URL-encoded%XX sequences that decode to readable text
Plain textNatural spacing and language, no structural fit

Production Best Practices & Security

Trust structure over charset — many alphabets overlap (a lowercase word without 0/O/I/l also fits Base58). Length divisibility and padding are the stronger signals. Why:charset alone cannot distinguish overlapping encodings.
Check the decoded preview — a high-confidence match that decodes to garbage is still wrong. Why:real encodings of real data usually produce readable text, images, or structured bytes.
Use delimiters when available — <~ ~> for ASCII85 or data:image/png;base64, make a format near-certain. Why:explicit framing removes ambiguity.
Verify checksums separately — the detective flags Bitcoin address shapes but does not verify Base58Check checksums. Use the Base58 tool for that.
Mind double-encoding — %2520 decodes to %20, not a space. Decode one layer at a time and re-check.

Frequently Asked Questions

The Encoding Detective identifies which encoding an unknown string uses. Paste any text — a hash-looking hex blob, a JWT segment, a TOTP secret, a crypto address, or a percent-escaped URL — and the tool ranks the likely candidates: Hex, Base64, Base64URL, Base32, Base58, ASCII85, URL percent-encoding, and plain UTF-8 text.

Each candidate comes with a confidence score, the evidence behind it, and a live decoded preview so you can verify the match before opening the full tool.