use case

How to encode a string to Base64

Convert plain text to a Base64 string for use in APIs, HTTP headers, or data URIs.

Base64 encoding is required whenever you need to pass text or binary data through a channel that only accepts ASCII characters. The most common cases are: embedding a username:password credential in an HTTP Basic Authorization header, encoding image bytes as a data URI for HTML or CSS, and passing JSON payloads through systems that reject certain bytes. This guide shows how to Base64-encode any string in under 10 seconds without installing software.

Step-by-step guide

  1. Open the encoder: Go to quickhelp.dev/base64. The mode defaults to 'encode'.
  2. Paste your string: Paste the text you want to encode into the input field. It can contain Unicode characters — the encoder converts them to UTF-8 bytes before encoding.
  3. Choose standard or URL-safe: For HTTP headers or general use, keep 'standard'. For URLs, JWT payloads, or filenames, select 'url-safe'.
  4. Copy the result: The encoded string appears instantly. Click Copy to put it on your clipboard.

Frequently asked questions

How do I encode credentials for HTTP Basic Auth?
Combine username and password as 'username:password', encode the whole string with standard Base64, then prefix the result with 'Basic ': Authorization: Basic dXNlcjpwYXNz.
Why does my Base64 string differ between tools?
The most common cause is a trailing newline in the input. Make sure you paste only the exact string, with no leading or trailing whitespace.

Try it now

Use the Base64 Encoder / Decoder to complete this task — free, no sign-up, runs in your browser.

Open Base64 Encoder / Decoder

We use cookies to serve ads and measure traffic. Cookie policy · Privacy policy