Base64 Decoder

Decode Base64-encoded strings back to plain text, JSON, credentials, or binary content instantly.

What is Base64 Decoding?

Base64 decoding is the process of converting a Base64-encoded string back into its original binary or text form. It is the exact reverse of Base64 encoding. Given a Base64 string such as SGVsbG8sIFdvcmxkIQ==, a Base64 decoder produces the original data: Hello, World!.

Base64 strings are recognisable by their structure: they consist only of alphanumeric characters (A–Z, a–z, 0–9) plus the + and / characters, often followed by one or two = padding characters. The URL-safe variant of Base64 (used in JWTs) replaces + with - and / with _.

Developers encounter Base64-encoded data constantly: in JWT tokens, in HTTP Authorization headers, in data URIs embedded in HTML and CSS, in API response payloads, and in configuration files. Being able to quickly decode these strings to inspect their contents is an essential debugging skill.

This tool uses PHP's base64_decode() function with strict validation mode enabled, which means it will return an error if the input string contains characters that are not valid Base64 characters, rather than silently producing incorrect output.

How to Use This Base64 Decoder

  1. Paste the Base64 string: Copy a Base64-encoded string and paste it into the left text area. You can include or omit the = padding — the tool handles both.
  2. Click "Decode Base64": The tool will validate your input and display the decoded result on the right. If the input contains invalid characters, you'll receive a clear error message.
  3. Review the output: The decoded text will be displayed in the output box. If it was JSON, you'll see the raw JSON string. If it was plain text or credentials, those will appear directly.
  4. Copy and use: Click Copy Output to copy the decoded content to your clipboard.

Tip: When decoding JWT tokens, only decode the second segment (the payload). JWT tokens are in the format header.payload.signature — each section is individually Base64URL-encoded.

Why is Base64 Decoding Useful?

  • JWT Inspection: Quickly decode the header and payload sections of a JSON Web Token to inspect claims, expiry times, user roles, and other metadata without needing to use a full JWT debugger.
  • API Debugging: Many APIs return Base64-encoded values in their responses (e.g., cursor pagination tokens, binary data, encrypted blobs). Decoding these helps you understand the data structure.
  • Reading Configuration Files: Kubernetes secrets, Docker configs, and CI/CD pipeline variables are often stored as Base64-encoded strings. Decoding them reveals the original configuration values.
  • Email Debugging: MIME email bodies and attachments are Base64-encoded. Decoding them lets you inspect the raw content of emails and attachments at a protocol level.
  • Data URI Extraction: Data URIs containing Base64-encoded images or fonts can be decoded to retrieve and save the original file.
  • Security Research: Examining encoded payloads in security incidents, phishing attempts, or malware samples often involves Base64 decoding as a first step.

Base64 Decoding Examples

Example 1 — Simple String
Input:   SGVsbG8sIFdvcmxkIQ==
Output:  Hello, World!
Example 2 — JWT Payload Segment
Input:   eyJ1c2VyIjoiYWxpY2UiLCJyb2xlIjoiYWRtaW4ifQ==
Output:  {"user":"alice","role":"admin"}
Example 3 — Basic Auth Credentials
Input:   YWRtaW46c2VjcmV0cGFzc3dvcmQ=
Output:  admin:secretpassword

To encode text to Base64, use our companion Base64 Encoder tool.