Smart Decode (Magic Decoder)

Auto-detect and decode Base64, hex, URL-encoding, JWT, HTML entities, Base32/58/85, Quoted-Printable, gzip and more, layer by layer — like CyberChef's Magic.

Paste something opaque — Base64 (gzip or zlib inside it too), hex, URL-encoded, a JWT, HTML entities, Base32, Base58, Ascii85/Z85, \u or \x escapes, binary, decimal or octal bytes, Quoted-Printable, UUencode or Punycode — and it auto-detects and decodes, layer by layer.

You can also drop a text file onto the box.

Decode encoded text automatically

Paste some opaque text and this tool figures out how it’s encoded and decodes it for you — no need to know whether it’s Base64 (with gzip, zlib or deflate inside it, too), hex, URL-encoding, a JWT, HTML entities (the whole HTML 4 named set), Base32, Base58, Ascii85 or Z85, \u or \x escapes, binary, decimal or octal bytes, Quoted-Printable, UUencode or Punycode. When the result is itself still encoded, it keeps going, peeling one layer at a time and showing you the chain it detected and, under “Each layer, as it came off”, the text each layer left. When the answer is a file rather than text, it says so, shows the first bytes in hex and offers the file as a download. Under the answer, a line measures it — characters for a text answer, bytes, and its entropy in bits per byte beside the most that many bytes could reach — and a text file can be dropped onto the box as well as opened.

Inspired by CyberChef’s “Magic” operation, it runs a small deterministic detector pipeline entirely in your browser. Your input is never uploaded, so it’s safe for tokens and other sensitive strings.

Frequently asked questions

What encodings does it detect?

JWT, URL-encoding (%XX), HTML entities, hexadecimal, Base64 / Base64URL — with gzip, zlib or raw deflate inside it decompressed as one more layer — Base32, Base58, Ascii85, Z85, \u and \x escapes, binary, decimal and octal bytes, Quoted-Printable, UUencode and Punycode, chained up to several layers deep.

Why does it say it can’t detect an encoding?

The input already looks like plain text, or uses a format outside the supported set. When the string has a shape the page knows — a hex hash, a bcrypt hash, a UUID, an IP or MAC address, an email address, a URL, a Unix timestamp, a PEM block, an SSH public key, JSON or an AWS access key ID — it says “Nothing to decode — this looks like …” and names it instead, adding for a hash that it can only be compared, not decoded. Values that decode to binary noise are treated as plain text so they aren’t mangled — unless the bytes start like a known file (PNG, PDF, ZIP and the like) or come from an encoding that cannot be mistaken, such as Base64 with its = padding, UUencode or Ascii85; then the answer is offered as a file to download.

Is it safe to paste a token?

Yes. Everything runs locally in your browser and nothing is sent anywhere — but never share a real secret you don’t control.

What happens when Base64 hides gzip, or decodes to a file?

Base64 whose bytes start with a gzip or zlib header is inflated as a layer of its own and shows up in the chain as Base64 + gzip or Base64 + zlib; raw deflate, which has no header, is tried after plain Base64 fails. A layer that would inflate past a size cap is refused, and the bytes are offered as the .gz they are instead. When the answer is a file, the page says so — its size and, when it starts like one, the kind of file, such as a .png — shows its first bytes in hex, and puts Download the file where Copy would be.

What if it picks the wrong reading, or I have a list to decode?

When the input can be read more than one way, “It also reads another way” lists the other readings, each with its chain and the start of its answer, and “Use this reading” switches the answer, the steps and Copy to it — 65 66 67 reads as hex, efg, and one click away as the decimal bytes ABC. The order is the only ranking; no reading is given a percentage. “Each layer, as it came off” shows the text every layer left before the last. Tick “Decode each line on its own” and each line is decoded in its place, a line nothing decodes is left as it was, and the page says how many lines decoded.

Can I drop a file on it, or see how random the answer looks?

Yes. A text file dropped onto the box is read like one opened with Open file… — the same file types, the same size limit, its encoding worked out — and anything else is refused as not a text file; if a second file lands while the first is still being read, the later one wins. Under the answer, one line measures it: characters for a text answer, bytes, and its Shannon entropy in bits per byte beside the most that many bytes could reach. A file answer is measured over its bytes. An answer near that maximum reads like random bytes — compressed or encrypted data rather than text.