Base64 Decoder Online: Decode Base64 to Text, Hex & File

Base64 Decoder

Decode Standard (RFC 4648), URL-Safe, MIME, and Data URI Base64 strings into UTF-8 text, hexadecimal byte dumps, or downloadable binary files. Inspect 6-bit quartet to 8-bit byte transformations and detect invalid Base64 characters in real time.

Base64 Encoded Input Valid RFC 4648 Standard
Load Real-World Base64 Sample:
Decoded Output Detected: JSON Object (UTF-8)
Encoded Length
72 chars (0 '=' pad)
Decoded Size
54 bytes (432 bits)
Size Change
-25.0% (72 → 54 B)
Alphabet & Stream
Standard (18 Quartets)

Live Base64 Quartet-to-Byte Bit Inspector (First 4 Characters → 3 Bytes)

Base64 decoding converts each 4-character quartet (4 × 6 bits = 24 bits) into up to 3 raw 8-bit bytes. Below is the live bit-level breakdown of the first quartet from your current input (eyJ0):

Stage Slot 1 Slot 2 Slot 3 Slot 4
1. Base64 Character e (Index 30) y (Index 50) J (Index 9) 0 (Index 52)
2. 6-Bit Sextet 011110 110010 001001 110100
3. Regrouped 8-Bit Bytes 01111011 (0x7B = 123) 00100010 (0x22 = 34) 01110100 (0x74 = 116) 24 bits → 3 bytes
4. Decoded ASCII / Byte { " t Combined: {"t

How Base64 Decoding Works (RFC 4648 Algorithm)

1. Map 4 Base64 chars (c0, c1, c2, c3) to 6-bit indices (s0, s1, s2, s3 ∈ [0..63])
2. Combine into 24-bit integer: N = (s0 << 18) | (s1 << 12) | (s2 << 6) | s3
3. Extract three 8-bit bytes:
Byte 0 = (s0 << 2) | (s1 >> 4)
Byte 1 = ((s1 & 0x0F) << 4) | (s2 >> 2) [omitted if c2 is '=']
Byte 2 = ((s2 & 0x03) << 6) | s3 [omitted if c3 is '=']

Standard vs. URL-Safe Alphabet: Standard Base64 (RFC 4648 §4) uses + for index 62 and / for index 63. URL-Safe Base64 (RFC 4648 §5, used in JWTs and URL parameters) replaces them with - (hyphen) and _ (underscore) and frequently omits trailing = padding.

Illustrative Base64 Decoding Examples

Example 1 — Padded Text String (Illustrative): Decode dXNlcjpwYXNzd29yZDEyMw== (an HTTP Basic Authentication payload):

  • Quartet Count: 24 characters = 6 quartets, ending with two = padding characters.
  • Byte Calculation: (6 × 3) − 2 = 16 bytes.
  • Decoded UTF-8 String: user:password123.

Example 2 — URL-Safe Base64 String (Illustrative): Decode aHR0cHM6Ly9leGFtcGxlLmNvbS8_cT0x:

  • URL-Safe Detection: Contains _ at position 28 (index 63 in RFC 4648 §5, replacing /).
  • Decoded UTF-8 String: https://example.com/?q=1 (24 bytes).

How to Use the Base64 Decoder

  1. Paste or Load Base64 Input: Paste your encoded string into the left input box, click one of the sample chips, or click Load .txt / .b64 File to read a file from your computer.
  2. Choose Alphabet & Encoding Options: Leave Auto-Detect enabled to handle Standard (+ /), URL-Safe (- _), and data:...;base64, strings automatically, or enforce strict RFC 4648 rules.
  3. Inspect Text, Hex, or Binary: Switch between Decoded Text, Hex & ASCII Dump, and 8-Bit Binary tabs to examine the decoded bytes.
  4. Copy, Download, or Re-Encode: Click Copy Output to copy the active view, Download File to save the raw decoded bytes, or edit the decoded text and click Re-Encode Text ↑ to encode it back into Base64.

Frequently Asked Questions

Why does native browser atob() fail on UTF-8 characters and emojis?

JavaScript's built-in atob() treats every decoded byte as a single-byte Latin-1 character, which corrupts multi-byte UTF-8 sequences (such as accented letters, CJK characters, or emojis) into mojibake. This decoder converts Base64 directly into a Uint8Array byte buffer and decodes it with a UTF-8 TextDecoder.

Why is a Base64 string invalid when its length divided by 4 leaves a remainder of 1?

Each Base64 character carries 6 bits of data. A single trailing Base64 character provides only 6 bits, which is not enough to form a single 8-bit byte. Valid unpadded Base64 strings can only have lengths with a remainder of 0, 2 (12 bits → 1 byte), or 3 (18 bits → 2 bytes) when divided by 4.

How do I decode a JWT (JSON Web Token) payload with this tool?

A JWT consists of three dot-separated URL-Safe Base64 parts (header.payload.signature). Copy either the header or payload segment into the input box; with Auto-Detect and Auto-repair missing '=' padding checked, the JSON claims decode immediately.

Is my Base64 data sent to any server when decoding?

No. All decoding, validation, hex formatting, and file downloads execute locally inside your browser using client-side JavaScript.