Base64 Text Encoder & Decoder
Encode text to Base64 or decode Base64 strings instantly.
About Base64 Encoder / Decoder
Encode any text string to Base64 or decode a Base64 string back to plain text. Supports standard Base64 and URL-safe Base64 (replacing + and / with - and _). One-click copy for both encoded and decoded output. All processing is done in your browser using the built-in btoa() and atob() functions.
Use Cases
Encoding credentials for Basic Auth headers, decoding Base64 values from API responses, encoding data for data URIs, working with JWT payload strings, debugging Base64-encoded config values.
How It Works
Uses the browser's built-in btoa() for encoding and atob() for decoding, with proper UTF-8 handling via TextEncoder/TextDecoder for non-ASCII characters. URL-safe mode replaces + with - and / with _ per RFC 4648.
FAQs
Does it support Unicode and non-ASCII characters?
Yes. The tool uses TextEncoder to convert Unicode strings to UTF-8 bytes before encoding, and TextDecoder to reverse the process. Standard btoa() alone does not handle Unicode.
What is URL-safe Base64?
Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 replaces these with - and _ so the encoded string can be used safely in query parameters without URL encoding.
What is the difference between this and Image to Base64?
This tool encodes text strings. The Image to Base64 tool encodes binary image files. They use the same encoding algorithm but with different input types.