Skip to content
Marvin's Toolbox.

Search tools

Type to filter all tools

Magic Decoder

Paste anything that looks encoded and this tool works out what was used and undoes it, layer by layer. The whole BaseXX family from Base16 to Base85, binary, URL escapes, HTML entities, ROT13 and gzip, Brotli or Zstandard compression are detected in any combination, and every step of the chain is reported.

Everything runs locally in your browser. Your data never leaves your device.

Input

The decoder tries the whole BaseXX family (Base16 hex, Base32 and Base32hex, Base36, Base45, Base58, Base62, Base64, Ascii85 and Z85), binary, URL escapes, HTML entities, Unicode escapes, ROT13 and gzip, deflate, Brotli and Zstandard compression, stacked in any order, until nothing is left to undo.

Next steps

Send this tool's output straight into another tool.

Paste JSON to explore it as a collapsible, searchable tree, hide the fields you don't need, and see the structure it implies as a badge-annotated schema and a copyable TypeScript interface.

Convert config and data between JSON, YAML, TOML, JSON5, INI, XML, CSV and .env. Type or paste on the left, pick the output format on the right, and copy the result. Includes a format button and a minify toggle.

Compare two JSON documents by structure and see every added, removed and changed key and value with its exact path. Browse the result as a tree, a filterable change list or a line diff, ignore array order, catch type changes and export the changes as a JSON report.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Paste a UUID to see what it carries: version, variant, and for time-based versions the exact timestamp, clock sequence and node. Also shows the raw bytes, the 128-bit integer and the URN form.

About the Magic Decoder Tool

This tool figures out how a piece of text was encoded and undoes it for you, even when several encodings are stacked on top of each other. Paste the mystery string and it checks for the whole BaseXX family, Base16 hex, Base32 and Base32hex, Base36, Base45, Base58, Base62, Base64 and both Base85 flavors (Ascii85 and Z85), plus binary, URL percent escapes, HTML entities, Unicode escapes, ROT13 and gzip, deflate, Brotli or Zstandard compression, applies the most likely one, and repeats on the result until nothing is left to decode.

Every layer is listed as a step in the decoding chain, with a note on what was detected and a preview of the intermediate value, so you can follow exactly how the tool got from the input to the answer. Common real-world quirks are handled on the way: Base64 with missing padding or the URL-safe alphabet, hex with 0x prefixes or separators, whitespace and line breaks in the middle of the data.

What you can do

  • Decode a string without knowing what encoding was used.
  • Unwrap multiple layers in one go, for example URL encoding over Base64 over gzip.
  • Decode every common BaseXX: Base16, Base32, Base32hex, Base36, Base45, Base58, Base62, Base64 and Base85 (Ascii85 and Z85).
  • Fix Base64 with missing padding or the URL-safe alphabet automatically.
  • Read hex and binary dumps with prefixes, separators and line breaks.
  • Decompress gzip, deflate, Brotli and Zstandard payloads found inside the data.
  • Spot ROT13 by checking whether the rotated text reads like English.
  • Pretty-print results that turn out to be JSON.
  • Preview binary results as an image, PDF, audio or video, or inspect them in a hex view.
  • Download binary results with the right file extension.

How to use the Magic Decoder

  1. 1Paste the encoded text, or press Try an example to see a three-layer chain unwind.
  2. 2Read the decoding chain to see which encodings were detected and in what order.
  3. 3Copy or download the decoded result, or an intermediate value from any step.

How the detection works

Some encodings announce themselves clearly: percent escapes, HTML entities, Base64 padding, the <~ ~> wrapper of Ascii85, or the magic bytes of gzip and Zstandard. Others are ambiguous, an eight-character word can be valid hex, Base58 and Base64 at the same time. The tool ranks all plausible readings by confidence and only accepts an ambiguous one when its output actually looks meaningful, readable text, a recognizable file format or another decodable layer. That is what keeps ordinary words from being decoded into garbage.

The alphabet narrows things down further: a digit 8 rules out standard Base32, a lowercase letter rules out Base45, a 0 or uppercase O rules out Base58. Brotli and raw deflate carry no signature at all, so they are tried speculatively on binary data and kept only when the result makes sense. ROT13 is detected by comparing how much the text reads like English before and after rotation.

When the result is binary

Not every chain ends in text. If the final bytes are an image, an archive or something else binary, the tool recognizes common file types from their magic bytes. Images, PDFs, audio and video render as a preview right on the page, other formats appear as a hex dump, and the download gets a fitting file name. For compressed files and stubborn cases the Data Decompressor gives you manual control, and the Base64 Encoder & Decoder tool covers plain single-layer jobs.

Honest limits

The tool decodes, it does not decrypt. Encrypted data has no structure to detect, so ciphertext stays ciphertext. Encodings with custom alphabets, Base91 or Morse are not covered yet, and for genuinely ambiguous short strings the most confident reading wins, which is occasionally not the one you meant. The number-style bases (Base36, Base58, Base62) are only applied when the decoded bytes make sense, so a Bitcoin address, which decodes to opaque binary, is deliberately left alone.

Credits

Open source does the heavy lifting in this tool. Thank you to:

  • brotli-wasm

    Google's Brotli compression, compiled to WebAssembly.

  • zstd-wasm

    A WebAssembly build of Zstandard, the fast modern compression format.

Everything this site builds on is listed on the credits page.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Escape text into HTML entities or decode entities back to plain text. Choose named or numeric entities, escape only the unsafe characters or everything outside ASCII, and read the result live.

Turn any text into a clean URL slug. Transliterates accents and non-Latin scripts to ASCII, with options for the separator, letter case and a length limit. Handles many titles at once, one line per slug.

Escape or unescape a string for JSON, JavaScript, regex, shell, SQL, CSV, XML and more. Paste text, pick the target format and copy the result, in either direction.

Encode text for use in URLs or decode percent-escaped strings back to readable text. Choose component, full-URL or form encoding, unwrap double-encoded strings, and break a URL into its parts with every query parameter decoded.

Format code in JavaScript, TypeScript, JSON, JSON5, HTML, Vue, CSS, SCSS, LESS, Markdown, YAML, GraphQL, XML and SQL. Pick tabs or spaces, set the indent width, and format the input in place with one click.