Base64 Encode — Convert Text to Base64 Online

Instantly encode any text to Base64. Handles all Unicode characters including emoji, CJK text, and accented characters. Supports URL-safe output and MIME line breaks.

Quick Base64 Encoding

Need to quickly encode a string for an API call, auth header, or config file? Type or paste below and copy the output. The conversion happens in real time as you type — no buttons to click, no forms to submit. This is the fastest way to get a Base64-encoded string.

Code Examples

JavaScript: btoa(unescape(encodeURIComponent(str)))
Python: base64.b64encode(text.encode('utf-8')).decode()
PHP: base64_encode($text)
Java: Base64.getEncoder().encodeToString(text.getBytes(UTF_8))
Go: base64.StdEncoding.EncodeToString([]byte(text))

Common Encoding Scenarios

HTTP Basic Auth: encode username:password for Authorization header
Data URIs: embed small files inline in HTML, CSS, or JSON
Email: encode binary attachments for MIME transport
APIs: send binary data through text-only JSON endpoints
Config: store binary values in .env files or YAML configs

Type or paste text below to encode it to Base64.

Plain Text0 B
Base64 Output
Base64 output will appear here...