Base64 Decoder — Turn Base64 Back into Text, Bytes or an Image

Paste a Base64 string to decode it back to readable text. Missing padding, line breaks, URL-safe characters and data URI prefixes are all handled, and images are shown as a preview.

Live demo · real result from this tool

Decoded text

ToolsRift decodes Base64 locally 🔐

Processed on your device — nothing is uploaded.

How to use the Base64 decoder

  1. Paste your string into Base64 to decode. A full data URI is fine.
  2. Read the Decoded text that appears.
  3. If the data is an image, check the preview, format, size and dimensions.
  4. If the data is binary but not an image, read the bytes as hex.
  5. If you see an error, it names the character and position that is not valid Base64.

What it does and when to use it

Base64 strings turn up all over the place, and they are unreadable until decoded. This decoder is useful when you need to:

  • Read the header or payload of a JWT. For a full breakdown of a token, the JWT Debugger does more.
  • Check what a Basic Authorization header contains while debugging an API.
  • Inspect a Base64 value in a config file, a Kubernetes secret or an API response.
  • Look at an inline image from a data URI in some HTML or CSS.
  • Find out whether a mystery string is text, an image or other binary data.

To encode text, use the Base64 Encoder. If what you have is full of % signs rather than letters and digits, it is percent-encoded, so use the URL Decoder. For a larger image preview with a download option, try Base64 to Image.

How it works

  1. Any data URI prefix (such as data:image/png;base64,) and all whitespace are removed.
  2. URL-safe characters (- and _) are read the same as standard ones (+ and /), and missing padding is allowed.
  3. Each group of four characters becomes three bytes, following RFC 4648.
  4. The tool checks the first bytes for the signature of a known image format. If it finds one, it shows the image and reads its dimensions from the file header.
  5. Otherwise it tries to read the bytes as UTF-8 text. If they are not valid UTF-8, it shows them as hex with a warning, instead of garbled characters.

Everything runs in your browser.

Worked examples

Padding left off. “SGVsbG8sIHdvcmxkIQ” has no = at the end but still decodes to Hello, world!

URL-safe input. “Y2Fmw6kg8J-Riw” contains a -, from the URL-safe alphabet, and decodes to café 👋, with the accent and emoji intact.

A tiny image. A 60-character string starting “R0lGOD” decodes to a 43-byte GIF. The tool shows the preview, Format: GIF and Dimensions: 1 × 1 px. Base64 images often start with recognisable letters: “iVBOR” for PNG, “/9j/” for JPEG and “R0lGOD” for GIF.

A typo. “SGVsbG8*” stops with a message that the “*” at position 8 is not a Base64 character.

Limits and tips

  • Text is decoded as UTF-8. Text originally saved in another character set may show odd characters.
  • Some strings happen to look like Base64 but are not. If the result is nonsense, the input was probably not Base64 at all.
  • Decoding a value does not check that it is genuine. A decoded JWT has not been verified.

Frequently asked questions

Do I need the = padding at the end?
No. Many systems strip the padding, and JWTs never include it. The decoder works out the missing padding for you.
Can it decode URL-safe Base64?
Yes. It accepts both alphabets, even mixed together, so values with - and _ decode just like those with + and /. Spaces and line breaks are ignored too.
Why is the result shown as hex instead of text?
Because the decoded bytes are not valid UTF-8 text. That usually means the original data was binary, such as a compressed file, a key or an image format the tool does not recognise. Hex lets you see the exact bytes without garbled characters.
Can I see an image from a Base64 string?
Yes. If the decoded bytes are a PNG, JPEG, GIF, WebP, BMP, ICO, AVIF or SVG image, the tool shows a preview with the format, size and dimensions. You can paste a full data URI such as data:image/png;base64,… as well.
Is it safe to decode a token or secret here?
Decoding runs in your browser and nothing is uploaded. Remember that anything in Base64 can be read by anyone who has it, so a Base64 value is never a safe place to keep a secret.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close