Base64 Encoder & Decoder
Convert text to Base64 and back, with full Unicode support.
Updated · Examples checked by automated tests
Base64 output
The converted value appears here.
About Base64 Encoder & Decoder
Base64 represents arbitrary bytes using 64 printable ASCII characters, which lets binary data travel safely through channels that only accept text - email bodies, JSON payloads, data URLs and HTTP headers.
The trade-off is size: the encoded form is roughly a third larger than the input. This tool encodes and decodes in both the standard and URL-safe alphabets and correctly handles multi-byte UTF-8 characters in both directions.
How Base64 Encoder & Decoder works in your browser
Encoding uses the browser’s built-in btoa and atob, wrapped in a TextEncoder and TextDecoder pass. That wrapper is the important part: btoa operates on Latin-1 and throws on any character above U+00FF, so encoding text containing an accent, a Cyrillic character or an emoji fails without it. Converting to UTF-8 bytes first means any Unicode input encodes and round-trips correctly.
Base64 represents three bytes as four ASCII characters, so encoded output is always about 33% larger than the input — worth remembering before embedding a large image as a data URI.
Base64 is an encoding, not encryption. It is trivially reversible by anyone, and offers no confidentiality whatsoever. It exists to move binary data safely through channels that only handle text.
When to use it
- Embedding a small image or font directly in CSS or HTML as a data URI to remove a request.
- Decoding a Base64 field from an API response, a config file or an email header to see what it holds.
- Preparing a value for a header or URL where raw binary would not survive transit.
- Decoding a payload that contains credentials — the reversibility of Base64 is exactly why that should happen locally.
Worked examples
Encode text with non-English characters
Settings: Encode
Input
Hello, wörld!Expected output
SGVsbG8sIHfDtnJsZCE=Text is converted to UTF-8 bytes before encoding, so ö becomes two bytes. Tools that use btoa directly fail on characters like this.
Make Base64 safe for a URL
Settings: Encode, URL-safe alphabet on
Input
<<???>>Expected output
PDw_Pz8-PgURL-safe Base64 replaces + with -, / with _ and drops the = padding, so the result can sit in a URL or filename without escaping. Standard Base64 for the same input is PDw/Pz8+Pg==.
Limits and checks before you use the result
- Base64 is an encoding, not encryption. Anyone can decode it.
- Encoded output is about a third larger than the input.
- Decoding expects the result to be UTF-8 text. Binary data such as images should go through Base64 to Image instead.
Frequently asked questions
Does this handle emoji and accented characters?
Yes. Text is encoded as UTF-8 first, so any Unicode character round-trips correctly - unlike a raw call to the legacy btoa function.
What is URL-safe Base64?
A variant that replaces the plus and slash characters with hyphen and underscore and drops the padding, so the result can be used in a URL or filename without escaping.
Is Base64 encryption?
No. It is an encoding, fully reversible by anyone. Never use it to protect secrets.
Related tools
URL Encoder & Decoder
Percent-encode and decode URLs, query strings and components.
HTML Entity Encoder
Escape and unescape HTML entities to display markup safely.
Unix Timestamp Converter
Convert Unix timestamps to human dates and back, in UTC and local time.
Hash Generator
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes from text or files.
SQL Formatter
Format SQL queries with consistent keyword casing and indentation.
XML Formatter
Pretty-print and validate XML documents with proper indentation.