Blog
Custom Print on Demand Apparel — Free Storefront for Your Business
Wild & Free Tools

Base64 Encode a String Online — Free, Instant, No Upload

Last updated: April 20267 min readEncode/Decode Tools

Paste text, get Base64. Any language, any special characters. The encoding runs in your browser so nothing gets uploaded anywhere.

Encode Text to Base64

  1. Open the Base64 Encoder
  2. Type or paste your text
  3. Click Encode
  4. Copy the Base64 output

Encode any text to Base64. Private, instant, free.

Encode Now →

How Base64 Encoding Works

Base64 takes every 3 bytes of input and converts them into 4 characters from a 64-character alphabet: A-Z (26), a-z (26), 0-9 (10), + and / (2). The equals sign = is used for padding when the input length is not evenly divisible by 3.

Step by step for "Hi":

  1. H = 72, i = 105 in ASCII
  2. Binary: 01001000 01101001
  3. Split into 6-bit groups: 010010 000110 1001
  4. Pad the last group: 010010 000110 100100
  5. Map to Base64 alphabet: S, G, k
  6. Add padding: SGk=

Result: "Hi" encodes to "SGk="

Common Encoding Examples

Original TextBase64 EncodedSize Increase
Hello WorldSGVsbG8gV29ybGQ=11 → 16 chars (+45%)
user:passworddXNlcjpwYXNzd29yZA==13 → 20 chars (+54%)
{"key":"value"}eyJrZXkiOiJ2YWx1ZSJ915 → 20 chars (+33%)
https://example.comaHR0cHM6Ly9leGFtcGxlLmNvbQ==19 → 28 chars (+47%)

When to Use Base64 Encoding

Embedding Data in JSON

JSON does not support binary data. If you need to include a file, image, or binary blob in a JSON payload, Base64-encode it first. The receiving end decodes it back to binary.

HTTP Basic Authentication

The HTTP Authorization header for Basic auth expects username:password encoded as Base64. This is why you see headers like Authorization: Basic dXNlcjpwYXNzd29yZA==. Remember: this is encoding, not encryption. Always use HTTPS with Basic auth.

Data URIs in HTML/CSS

You can embed small images or fonts directly in HTML or CSS using data URIs: data:image/png;base64,iVBORw0KGgo.... This eliminates an HTTP request at the cost of a larger HTML file. Good for tiny icons, bad for large images.

Config Files and Environment Variables

Kubernetes secrets, CI/CD variables, and many cloud platforms store sensitive values as Base64. You encode when setting the value, and the system decodes when using it.

Base64 Encoding in Code

Note: JavaScript's btoa() does not support UTF-8 characters directly. You need to encode to UTF-8 first. Our browser tool handles this automatically.

Base64 Is Not Encryption

This is the most common misunderstanding. Base64 does not protect your data. Anyone can decode it. If you see a password stored as Base64 in a config file, that password is effectively in plain text. For actual security, use proper encryption, then optionally Base64-encode the encrypted output for safe transport.

Related Encoding Tools

Different encoding for different situations: URL Encoder for making strings URL-safe, HTML Entity Encoder for escaping HTML special characters, Hash Generator for creating one-way checksums (MD5, SHA-256).

Launch Your Own Clothing Brand — No Inventory, No Risk