What does the Base64 Decoder do?
The Base64 Decoder converts standard RFC 4648 or URL-safe Base64 encoded payload strings back into clean, human-readable UTF-8 plain text or raw binary data. If the decoded content is valid JSON, the tool automatically detects and formats the JSON structure for clear readability.
Core Concepts
Understanding Base64 decoding specifications:
- Alphabet Normalization: Converts URL-safe characters (
-and_) back to standard Base64 characters (+and/) and restores missing=padding before decoding. - Strict UTF-8 Reconstruction: Decodes binary byte buffers back into UTF-8 strings, preserving international unicode glyphs, accents, and emojis.
- Smart JSON Detection: Inspects decoded text buffers for valid JSON syntax and formats them with standard 2-space indentation.
How to use the tool?
- Paste Base64 Payload: Paste your standard or URL-safe Base64 string into the input editor or click Sample.
- Live Decode & Prettify: Decodes automatically in real time and prettifies if the payload is valid JSON.
- Inspect & Export: Review the decoded UTF-8 text and click Copy or Download to save the result.
Related Developer Utilities
If you work with Base64 decoding, token inspection, and URI formatting, explore these complementary tools:
- Base64 Encoder: Encode UTF-8 plain text into standard or URL-safe Base64 strings.
- Base64URL to Base64 Converter: Add padding and convert URL-safe Base64 to standard Base64.
- URL Encoder & Decoder: Encode and decode URI query strings.
- JSON Syntax Validator: Validate JSON syntax and inspect character offsets.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/base64/decoder) to programmatically decode standard or URL-safe Base64 strings into plain UTF-8 text.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText |
String / Object | Standard or URL-safe Base64 encoded string or object to decode (aliases: text, payload, data, input, value). |
"SGVsbG8gQmx1ZXV0aWxzIQ==" |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/base64/decoder \
-H "Content-Type: application/json" \
-d '{
"rawText": "SGVsbG8gQmx1ZXV0aWxzIQ=="
}'Python
import requests
url = "https://blueutils.com/api/base64/decoder"
payload = {
"rawText": "SGVsbG8gQmx1ZXV0aWxzIQ=="
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"rawText": "SGVsbG8gQmx1ZXV0aWxzIQ=="
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/base64/decoder"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether Base64 decoding succeeded. | true |
result |
String | Decoded UTF-8 text string. | "Hello Blueutils!" |
isJson |
Boolean | Indicates whether decoded text is valid JSON. | false |
formattedResult |
String | Prettified JSON text if isJson is true. |
"Hello Blueutils!" |
originalSize |
Number | Byte size of the input Base64 string. | 24 |
decodedSize |
Number | Byte size of the decoded UTF-8 string. | 16 |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"result": "Hello Blueutils!",
"isJson": false,
"formattedResult": "Hello Blueutils!",
"originalSize": 24,
"decodedSize": 16
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Invalid input: Base64 payload cannot be empty."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to decode Base64?
Integrating the Base64 Decoder API into authentication pipelines, log ingestion, or AI agent tool calling provides key benefits:
- Rapid Script Validation: Decodes Basic Auth credentials, webhook signatures, and data URI assets in backend microservices.
- Optimized Token Efficiency for AI Agents: LLMs struggle with manual Base64 bitwise decoding. Calling the API extracts the underlying UTF-8 payload deterministically without hallucination.
- Deterministic Accuracy Without Hallucinations: Ensures 100% accurate character decoding, auto-padding, and URL-safe substitution.
Native Usage
How to decode Base64 locally in terminal environments or scripts:
Windows (CMD / PowerShell)
# Decode Base64 in PowerShell
[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String("SGVsbG8gQmx1ZXV0aWxz"))Linux / Unix (Bash)
# Decode Base64 in Linux
echo -n "SGVsbG8gQmx1ZXV0aWxz" | base64 --decodePython
Using Python base64:
import base64
encoded_str = "SGVsbG8gQmx1ZXV0aWxz"
decoded = base64.b64decode(encoded_str).decode("utf-8")
print(decoded)Java
Using Java standard Base64:
import java.util.Base64;
import java.nio.charset.StandardCharsets;
public class Base64DecodeExample {
public static void main(String[] args) {
String encoded = "SGVsbG8gQmx1ZXV0aWxz";
byte[] decodedBytes = Base64.getDecoder().decode(encoded);
String decoded = new String(decodedBytes, StandardCharsets.UTF_8);
System.out.println(decoded);
}
}