admin@likeapro.dev: ~/encode — zsh

// admin tools · 05

Codec bench

Base64, Base64URL, URL, hex, HTML entities and binary — converted live as you type, UTF-8 safe, with a detector for mystery strings and a file → data URI packer.

// runs locally — nothing is uploaded

direction

ENCODE local only · 0 bytes sent --:--:--

How it works

What it does

A two-pane encoder and decoder for the formats that turn up in URLs, headers, configs and logs. It handles Base64, Base64URL, URL encoding (component and full URI), hex, HTML entities and binary. A detect mode ranks which encoding a mystery string is most likely to be. The --file tab turns any file into a Base64 data URI. It all runs in your browser.

How to use it

  1. Choose a codec and a direction (encode → or ← decode). The output updates as you type, with byte and character counts under each pane.
  2. Use ⇄ swap to move the output back into the input and flip direction, which is handy for round-trip checks.
  3. Not sure what you're looking at? Pick detect. Candidates are listed with a reason and a preview, and you can apply the best one in a click.
  4. In --file, drop a file of up to 25 MB to get a data: URI, the bare base64 and, for images, a preview and a CSS background-image line.

The codecs

Base64
Standard alphabet with +, / and = padding. Text is encoded as UTF-8 first, so emoji and accents round-trip correctly.
Base64URL
URL-safe alphabet (- and _) without padding, as used in JWTs. Decoding accepts either alphabet, with or without padding.
URL component
encodeURIComponent. Escapes everything except unreserved characters, for query values and path segments.
URL (full URI)
encodeURI. Keeps : / ? # & = intact so a whole URL stays usable.
Hex
Two hex digits per UTF-8 byte. Decoding ignores spaces and rejects an odd digit count.
HTML entities
Escapes & < > " ' and writes non-ASCII as numeric references. Decoding understands numeric and common named entities.
Binary
Eight bits per byte, space-separated.

How detection works

Each codec is tried in turn. Its result is scored on how well the input fits the alphabet — for example, Base64 length a multiple of four, or only 0 and 1 in 8-bit groups — and on whether the decoded bytes form valid, printable UTF-8. Hex-looking strings are ranked above Base64, because every hex string is also valid Base64.

FAQ

Is Base64 encryption?

No. It's a reversible encoding that anyone can decode instantly. Never use it to hide passwords or keys.

Why does decoding say the bytes aren't valid UTF-8?

The data is probably binary, such as an image, a compressed blob or a key, rather than text. Switch to the hex codec to see the raw bytes.

Component or full-URI encoding?

Use component for a single value going into a URL, such as ?q=. Use full URI only for a complete URL that contains spaces or non-ASCII characters. Component-encoding a whole URL breaks its :// and slashes.