>_
smartdevbox
Open SmartDevBox — free, no sign-up97+ tools · 100% client-side · no account required

Base64 Decoder — Decode Base64 Online, Free

Base64 Decoder converts Base64-encoded strings back into readable plain text entirely in your browser. Paste any Base64 string — with or without padding — and the decoded result appears instantly. Both standard Base64 (RFC 4648) and URL-safe Base64 variants are supported. No data is sent to a server; all decoding runs locally via JavaScript.

How Base64 Encoding Works

Base64 represents arbitrary binary data using only 64 printable ASCII characters: A–Z, a–z, 0–9, plus (+) and slash (/), with equals (=) used as a padding character. The algorithm groups the input bytes into sets of three (24 bits) and re-encodes each group as four 6-bit Base64 characters. Because every possible byte value maps to a printable character, Base64 output can travel safely through any text-based channel — HTTP headers, JSON strings, email bodies, or XML attributes — without corruption.

The encoding increases size by roughly 33 %: 3 bytes of binary become 4 characters of text. If the input length is not a multiple of three, one or two = padding characters are appended so the total output length is a multiple of four. Some systems strip padding (common in JWTs and many APIs), which is why SmartDevBox accepts both padded and unpadded input.

URL-safe Base64 is a variant defined in RFC 4648 §5 that substitutes + with - and / with _ so the encoded string can appear in a URL path or query parameter without percent-encoding. JWTs always use URL-safe Base64 without padding for all three of their sections.

Decoding Step by Step

To decode Base64 manually, each character is looked up in the 64-character alphabet to get its 6-bit value. Four characters produce 24 bits, which are split back into three 8-bit bytes. Trailing = padding characters are ignored during the bit-split phase. In JavaScript the built-in atob() function handles standard Base64; URL-safe variants require replacing - with + and _ with / before calling atob().

A common pitfall is line breaks. Some Base64 generators insert a newline every 76 characters (MIME standard). Decoders must strip whitespace before processing, otherwise the line-break characters (ASCII 10 or 13) will cause an "invalid character" error. SmartDevBox strips all whitespace from the input automatically.

Another source of errors is Unicode: Base64 decodes to raw bytes, not JavaScript strings. If the original data was UTF-8 text, you must decode those bytes as UTF-8 after Base64-decoding. SmartDevBox applies TextDecoder with UTF-8 so multi-byte characters (emoji, CJK, accented letters) are displayed correctly.

Real-World Examples

HTTP Basic Authentication encodes credentials as Base64: the string username:password is Base64-encoded and sent in the Authorization header as "Basic dXNlcm5hbWU6cGFzc3dvcmQ=". Decoding that value reveals the credentials in plain text — a reminder that Basic Auth should only be used over HTTPS.

Email attachments use Base64 via MIME (Multipurpose Internet Mail Extensions). The raw bytes of a PDF or image are Base64-encoded and embedded in the email body. Your email client decodes them transparently when you open the attachment.

JSON Web Tokens consist of three dot-separated Base64url-encoded sections: header, payload, and signature. The payload section contains the claims — user ID, roles, expiry — encoded as Base64url. Pasting a JWT into this decoder (or into the dedicated JWT Decoder) reveals those claims immediately.

Common Use Cases

  • Decoding Base64-encoded API response payloads
  • Reading Base64-encoded email attachments (MIME)
  • Decoding embedded Base64 data URIs in HTML or CSS
  • Inspecting Base64-encoded secrets or tokens in config files
  • Converting Base64-encoded binary data back to text

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is widely used to transmit binary data over text-based protocols like HTTP, email (MIME), and JSON.

How do I decode a Base64 string online?

Paste your Base64 string into SmartDevBox. The tool automatically detects Base64 encoding and decodes it to plain text — no manual tool selection needed.

What is the difference between standard Base64 and URL-safe Base64?

Standard Base64 uses + and / as the 62nd and 63rd characters. URL-safe Base64 replaces them with - and _ so the encoded string can be used safely in URLs and file names without percent-encoding.

Can I decode a Base64 image data URI?

Yes. Paste a Base64 data URI (e.g. data:image/png;base64,...) and use the Base64 Image Decode tool to see the MIME type and byte size. To decode generic Base64, use this Base64 Decoder.

Privacy & Security

This tool runs entirely in your browser using client-side JavaScript. No data is sent to a server — your input never leaves your machine. SmartDevBox has no account system, no usage tracking, and no paid tier. See the Privacy & Security page for full details.

  • Base64 EncoderEncode any text or string to Base64 instantly in your browser. Free, no sign-up, 100% client-side. Results copy with one click.
  • Base64 Image DecoderDecode a Base64 image data URI and view MIME type, byte size, and HTML/CSS usage examples. Free, no sign-up.
  • URL DecoderDecode any percent-encoded URL string back to readable text instantly in your browser. Free, no sign-up, 100% client-side.
  • JWT DecoderDecode JWT tokens and inspect header, payload, and signature instantly. Free, no sign-up. Works without the signing secret. 100% client-side.
  • Find secrets in logsUse local extraction and inspection tools to catch common sensitive values before a log leaves your machine.