0
0

Base64 Encode

Egor VolchenkoEgor Volchenko
CreatedNov 17, 2026
UpdatedNov 17, 2026

Base64 Encode represents text or entered bytes as a standard Base64 string. Use this Base64 encoder to prepare test data for a field that expects Base64. Input Encoding: controls which bytes are encoded, so the same visible characters can produce different results under different settings.

1
1

How to use Base64 Encode

Follow these steps to check the input and read the result.

Encode text as standard Base64

  1. Type or paste the text or byte representation you want to encode into Plain Text String.
  2. Set Input Encoding: to UTF-8 for ordinary text. Choose Hex for entered hexadecimal bytes, or Base64 when the input already represents Base64-encoded bytes.
  3. Keep Auto / Live on to update the result as you edit. To process it manually, turn Auto / Live off and click Run.
  4. Read Base64 Encoded Result and check the result before using it.
  5. Click Copy to copy the result. Use Clear where shown, or a field’s clear control, to clear the text before starting again.

With Input Encoding: set to UTF-8, Hello produces SGVsbG8=. With Hex selected, 48656c6c6f produces the same result.

Choose bytes before choosing a representation

UTF-8 converts the entered characters to bytes before Base64 encoding. Hex 48656c6c6f represents the bytes of Hello; the same digits under UTF-8 represent ten text characters. Additional text encodings are available in Input Encoding: for compatibility testing.

Use standard output in the correct context

Output uses the standard Base64 alphabet and padding where needed. It is not automatically URL-safe, and the form has no output variant selector, file upload, or MIME line-wrapping control.

Encode bytes from Hex

Use the input selector when you already have a byte representation rather than plain text.

  1. Choose Hex in Input Encoding:.
  2. Enter 48656c6c6f in Plain Text String.
  3. Keep Auto / Live on or click Run, then copy SGVsbG8= from Base64 Encoded Result.

Frequently asked questions

No. Base64 is encoding, not encryption. It changes the representation of bytes without a secret key and can be decoded by anyone.

API — Text to Base64

Automate this tool directly from your scripts, CI/CD pipelines, or backend applications via HTTP POST.

No API Key Required 60 req/min
https://million.tools/api/v1/run/base64-encode

Request Parameters (JSON / Form Data)

  • start (or input)

    Plain Text String

    Type: string Default: —
  • input_encoding

    Input Encoding

    hex hex_ignore_non_hex base64 utf-8 utf-16le utf-16be windows-1251 windows-1252
    Type: string Default: utf-8
bash — cURL
curl -X POST https://million.tools/api/v1/run/base64-encode \
  -H "Content-Type: application/json" \
  -d '{"start":"foobar"}'
const response = await fetch('https://million.tools/api/v1/run/base64-encode', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "start": "foobar"
  }),
});

const data = await response.json();
console.log(data.result);
import requests

response = requests.post(
    'https://million.tools/api/v1/run/base64-encode',
    json={
        "start": "foobar",
    },
    timeout=15,
)

data = response.json()
print(data['result'])
$ch = curl_init('https://million.tools/api/v1/run/base64-encode');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'start' => 'foobar',
    ]),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

echo $response['result'] ?? '';
{
    "status": "success",
    "tool": "base64-encode",
    "service": "base64_encode",
    "result": "Zm9vYmFy",
    "results": {
        "result": "Zm9vYmFy"
    }
}
Egor Volchenko
Egor Volchenko Developer & Author

Hi! I’m a WordPress developer with over 10 years of experience. I love Tailwind CSS, clean code, and intuitive interfaces. I’m currently working on million.tools — a service with convenient online tools for everyday tasks. I’m building it from scratch with great attention to detail and user experience.

Published:
Updated:

Ratings & feedback 0

Share your experience with this tool.

Leave feedback

Your rating (optional)

Select a rating

Write a review, leave a rating, or do both.

Your email stays private.

No feedback yet

Be the first to leave a review or rating.