Skip to content

Base64 Decoder — Decode Any Base64 String Online

Free

Decode Base64 strings to text or download as a file. Supports standard and URL-safe Base64. Instant, free, no upload required.

decode base64base64 to textbase64 decoder free
All Developer Tools

Settings guide

Output format:

  • ·Text (UTF-8) — Decodes to a readable string. Use when the original content was text, JSON, XML, or any other character data.
  • ·Binary / file download — Downloads the decoded bytes as a file. Use when the original content was an image, PDF, ZIP, or other binary format.

URL-safe Base64 detection:

The decoder automatically detects whether the input uses standard (+ and /) or URL-safe (- and _) encoding. Both are handled without any setting change. Padding characters (=) are optional — the decoder handles padded and unpadded input.

Format comparison

Decoding Base64 vs decoding a JWT: A JWT has three Base64url-encoded segments separated by dots (header.payload.signature). Pasting a full JWT here decodes only the raw bytes of the string. For a structured view of all three JWT segments with claim names and expiry parsing, use the dedicated JWT Decoder.

Base64 decoder vs browser DevTools: Modern browsers decode Base64 in the DevTools console: atob("...") for standard Base64, or a custom function for URL-safe Base64. The online decoder is faster for large strings, handles URL-safe automatically, and can output binary as a downloadable file — things atob() cannot do directly.

How it works

1

Detect encoding variant

The input is scanned for URL-safe characters (- and _). Standard or URL-safe mode is applied automatically. Whitespace and line breaks are stripped before decoding begins.

2

Validate the string

The string length and padding are checked. Base64 strings must have a length that is a multiple of 4 (with padding) or the decoder calculates the correct length without it.

3

Decode groups

Every 4 Base64 characters are converted back to 3 bytes of original data. The character-to-6-bit mapping is reversed, and the bits are reassembled into bytes.

4

Output

Decoded bytes are displayed as text (UTF-8) or offered as a binary file download. If the decoded content is valid JSON, it is automatically formatted for readability.

About this format

A Base64 string in an API response, a JWT token, an email attachment, or a data URI all encode something you cannot read until you decode it. Paste the encoded string and the original content — text, JSON, binary data — is immediately visible or available for download.

Debugging use cases: reading the payload of a JWT without a dedicated JWT tool, inspecting what is inside an HTTP Basic Auth header, viewing the raw bytes of a data URI image, or reading a MIME-encoded email attachment.

The decoder handles both standard Base64 (`+` and `/`) and URL-safe Base64 (`-` and `_`) automatically — no manual selection required for most inputs.

Frequently asked questions

How do I decode a JWT token here?+
A JWT has three dot-separated segments: header.payload.signature. Each segment is Base64url-encoded. Paste only the middle segment (payload) to read the claims as JSON. For a full structured view of all three segments with expiry parsing, use the JWT Decoder tool instead.
Why does my Base64 decoded output look like gibberish?+
The original content was binary data (an image, PDF, or other file), not text. Switch the output mode to binary/file download to save the decoded bytes as a file. Text output of binary data will always appear as garbage characters.
What is the difference between Base64 and Base64url?+
Base64url is a URL-safe variant that replaces + with - and / with _ so the encoded string can appear in URLs without percent-encoding. JWT tokens use Base64url. The decoder handles both automatically.
My Base64 string has spaces in it — will it still decode?+
Yes. Whitespace (spaces, newlines, line breaks) is stripped before decoding. Base64 strings from MIME emails often have line breaks every 76 characters — these are handled automatically.
Can I decode a CSS data URI?+
Yes. A CSS data URI looks like `data:image/png;base64,iVBOR...`. Copy everything after the comma and paste it here with output mode set to binary/file download. The image is decoded and downloaded as a PNG.

Related tools and guides