Base64 Decoder

Decode Base64 to text

Base64 Input

Decoded Text

How to use the Base64 Decoder

  1. Paste your Base64 string into the input field. The tool accepts standard Base64 as well as URL-safe Base64 variants.
  2. Check for validity. If the input is not valid Base64, the tool will display an error indicating the problem, such as invalid characters or incorrect padding.
  3. View the decoded output in the output panel. Text content is displayed as readable text; the tool will indicate if the decoded content appears to be binary data.
  4. Copy the decoded text to your clipboard, or use it directly in your application.

What is Base64 decoding?

Base64 decoding is the reverse of Base64 encoding: it takes a string of Base64-encoded text and converts it back to the original binary data or text. The decoder maps each of the 64 characters back to its 6-bit value, reassembles the bits into bytes, and outputs the original data.

The decoding process reads four Base64 characters at a time, converts each to its 6-bit numeric value, concatenates these to form 24 bits, and then splits the result into three bytes. Padding characters (=) at the end signal that the last group had fewer than three bytes of original data, so the decoder knows to discard the extra bits.

When decoding to text, the resulting bytes need to be interpreted using the correct character encoding. UTF-8 is the most common encoding on the modern web. If the wrong encoding is used, special characters and non-ASCII text (like accented letters, Chinese characters, or emoji) may appear garbled. This tool defaults to UTF-8, which handles the vast majority of text correctly.

A common debugging scenario involves encountering Base64 strings in logs, configuration files, HTTP headers, or JWT tokens. Being able to quickly decode these strings helps developers understand what data is being transmitted. For example, decoding the payload section of a JWT token reveals the claims it contains, and decoding an HTTP Basic Auth header reveals the username and password being sent.

Invalid Base64 input can occur when a string has been truncated, contains characters outside the Base64 alphabet, or has incorrect padding. This tool provides clear error messages to help you diagnose such issues.

Common use cases

  • Debugging JWT tokens: JWTs contain Base64url-encoded header and payload sections. Decoding them reveals the claims and signing algorithm without needing a JWT-specific tool.
  • Reading HTTP Authorization headers: HTTP Basic Authentication sends credentials as Base64-encoded strings. Decoding the Authorization header reveals the username and password.
  • Extracting embedded data: Data URIs in HTML or CSS embed Base64-encoded content. Decoding lets you extract the original image, font, or other embedded resource.
  • Inspecting email content: Email attachments encoded with MIME Base64 can be decoded to recover the original files.
  • Debugging API payloads: Some APIs encode request or response bodies in Base64 for transport. Decoding reveals the actual data being exchanged.

FAQ

What if my Base64 string contains - and _ instead of + and /? That is URL-safe Base64 encoding, which uses - instead of + and _ instead of / to avoid issues with URL encoding. This tool handles both standard and URL-safe variants automatically.

Why am I seeing garbled text after decoding? The decoded bytes are being interpreted with the wrong character encoding. Make sure the original data was encoded as UTF-8. If it was encoded with a different character set (like ISO-8859-1), the decoded text may look incorrect.

Can I decode Base64 back to a file? This tool is designed for text output. To decode Base64 back to a binary file (such as an image or PDF), you would need a tool that can save the raw bytes to a file. Check out our Base64 Image Encoder/Decoder for image-specific decoding.

Is my data safe?

Yes. This tool runs entirely in your browser. Your data is never sent to our servers. Decoding is performed using the browser's native atob() function or equivalent, completely on your local device.

How to use the Base64 Decoder

  1. Paste your Base64 string into the input field. The tool accepts standard Base64 as well as URL-safe Base64 variants.
  2. Check for validity. If the input is not valid Base64, the tool will display an error indicating the problem, such as invalid characters or incorrect padding.
  3. View the decoded output in the output panel. Text content is displayed as readable text; the tool will indicate if the decoded content appears to be binary data.
  4. Copy the decoded text to your clipboard, or use it directly in your application.

What is Base64 decoding?

Base64 decoding is the reverse of Base64 encoding: it takes a string of Base64-encoded text and converts it back to the original binary data or text. The decoder maps each of the 64 characters back to its 6-bit value, reassembles the bits into bytes, and outputs the original data.

The decoding process reads four Base64 characters at a time, converts each to its 6-bit numeric value, concatenates these to form 24 bits, and then splits the result into three bytes. Padding characters (=) at the end signal that the last group had fewer than three bytes of original data, so the decoder knows to discard the extra bits.

When decoding to text, the resulting bytes need to be interpreted using the correct character encoding. UTF-8 is the most common encoding on the modern web. If the wrong encoding is used, special characters and non-ASCII text (like accented letters, Chinese characters, or emoji) may appear garbled. This tool defaults to UTF-8, which handles the vast majority of text correctly.

A common debugging scenario involves encountering Base64 strings in logs, configuration files, HTTP headers, or JWT tokens. Being able to quickly decode these strings helps developers understand what data is being transmitted. For example, decoding the payload section of a JWT token reveals the claims it contains, and decoding an HTTP Basic Auth header reveals the username and password being sent.

Invalid Base64 input can occur when a string has been truncated, contains characters outside the Base64 alphabet, or has incorrect padding. This tool provides clear error messages to help you diagnose such issues.

Common use cases

  • Debugging JWT tokens: JWTs contain Base64url-encoded header and payload sections. Decoding them reveals the claims and signing algorithm without needing a JWT-specific tool.
  • Reading HTTP Authorization headers: HTTP Basic Authentication sends credentials as Base64-encoded strings. Decoding the Authorization header reveals the username and password.
  • Extracting embedded data: Data URIs in HTML or CSS embed Base64-encoded content. Decoding lets you extract the original image, font, or other embedded resource.
  • Inspecting email content: Email attachments encoded with MIME Base64 can be decoded to recover the original files.
  • Debugging API payloads: Some APIs encode request or response bodies in Base64 for transport. Decoding reveals the actual data being exchanged.

FAQ

What if my Base64 string contains - and _ instead of + and /? That is URL-safe Base64 encoding, which uses - instead of + and _ instead of / to avoid issues with URL encoding. This tool handles both standard and URL-safe variants automatically.

Why am I seeing garbled text after decoding? The decoded bytes are being interpreted with the wrong character encoding. Make sure the original data was encoded as UTF-8. If it was encoded with a different character set (like ISO-8859-1), the decoded text may look incorrect.

Can I decode Base64 back to a file? This tool is designed for text output. To decode Base64 back to a binary file (such as an image or PDF), you would need a tool that can save the raw bytes to a file. Check out our Base64 Image Encoder/Decoder for image-specific decoding.

Is my data safe?

Yes. This tool runs entirely in your browser. Your data is never sent to our servers. Decoding is performed using the browser's native atob() function or equivalent, completely on your local device.