#️⃣

Base64 Decode

Decode standard or URL-safe Base64 strings back to plaintext.

POST 1 credit /v1/auth/base64-decode
curl -X POST "https://auth.toolkitapi.io/v1/auth/base64-decode" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "SGVsbG8sIFdvcmxkIQ==",
    "url_safe": false
  }'
import httpx

resp = httpx.post(
    "https://auth.toolkitapi.io/v1/auth/base64-decode",
    json={
    "input": "SGVsbG8sIFdvcmxkIQ==",
    "url_safe": false
  },
)
print(resp.json())
const resp = await fetch("https://auth.toolkitapi.io/v1/auth/base64-decode", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "input": "SGVsbG8sIFdvcmxkIQ==",
    "url_safe": false
  }),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "decoded": "Hello, World!",
  "encoding": "base64"
}

Try It Live

Live Demo

Description

Decode standard or URL-safe Base64 strings back to plaintext.

How to Use

1

1. Set the `input` field to the Base64-encoded string you want to decode.

2

2. Set `url_safe` to `true` if the string uses URL-safe Base64 encoding (with `-` and `_` instead of `+` and `/`).

3

3. Send a POST request and read the `decoded` value from the response.

About This Tool

The Base64 Decode endpoint converts a Base64-encoded string back to its original plaintext representation. It supports both standard Base64 and URL-safe Base64 decoding.

This is the companion to the Base64 Encode endpoint. Use it to decode data received from APIs, email headers, JWT segments, data URIs, or any other Base64-encoded source.

If the input is not valid Base64, the endpoint returns a 400 error with a descriptive message to help you identify the issue.

Why Use This Tool

Frequently Asked Questions

What if my Base64 string has no padding?
The decoder handles missing padding characters (`=`) gracefully. Both padded and unpadded Base64 strings are accepted.
Can I decode binary data?
The response returns the decoded content as a UTF-8 string. If the original data was binary (not valid UTF-8), the request will return an error. For binary data, consider using the multi-format encode endpoint with hex encoding.
How do I know if my string is URL-safe Base64?
If the string contains `-` or `_` characters (instead of `+` or `/`), it's URL-safe Base64. Set `url_safe: true` to decode it correctly.

Start using Base64 Decode now

Get your free API key and make your first request in under a minute.