Base64 Encode
Type or paste text and it is encoded to standard Base64 as you go, with a live character count above the output. Encoding runs through a UTF-8 encoder first, so accents, emoji and CJK characters survive the round trip instead of turning into garbled bytes. Flip on URL-safe mode when the result has to sit inside a URL, filename or JWT segment.
How to encode text to Base64
- Type or paste text into the Text input box, or click Load sample to drop in an example string.
- Leave URL-safe off for standard Base64, or tick 'URL-safe (base64url, no padding)' for a URL, filename or JWT.
- Watch the Base64 output update instantly, with the character count shown just above it.
- Click Copy to copy the result, or Download to save it as encoded.txt.
Examples
Encode a simple string
hello
aGVsbG8=
Accented text stays intact (UTF-8)
cafΓ©
Y2Fmw6k=
URL-safe output drops padding and swaps symbols
>>>?
Pj4-Pw
Frequently asked questions
What is Base64?
Base64 represents binary or text data using 64 printable ASCII characters plus padding. It is used to embed data in JSON, data URLs, email attachments and HTML, anywhere raw bytes could be mangled in transit.
Is Base64 encryption?
No. Base64 is reversible encoding, not encryption. Anyone can decode it straight back to the original text in seconds, so never rely on it to protect passwords, tokens or secrets.
What does the URL-safe option do?
URL-safe mode produces base64url: it replaces the plus sign with a hyphen and the slash with an underscore, then strips the trailing equals-sign padding. That makes the string safe to drop into URLs, filenames and JWT segments without escaping.
Does it handle emoji and accented characters?
Yes. Text is run through a UTF-8 encoder before Base64, so emoji, accents and other multi-byte characters encode correctly. For example cafe with an accented e becomes Y2Fmw6k=, which decodes back to the exact original.
Why is the output longer than my input?
Base64 turns every 3 bytes into 4 characters, so the encoded text is about one third larger than the source, plus a little padding. The character count above the output shows the exact length.
What is the equals sign at the end?
Standard Base64 pads the final group with one or two equals signs so the length is always a multiple of 4. URL-safe mode removes that padding, which is why a URL-safe result can look shorter.
Can I encode a file or image?
This tool encodes text you type or paste, not uploaded binary files. If you paste the text contents of a file it will encode fine, but picking a binary file such as a PNG is out of scope here.
How do I decode it back?
Run the result through a Base64 decoder to recover the original text. The default output here is standard Base64 that any decoder accepts; for URL-safe output use a decoder that understands base64url.
Is my text private?
Yes. Encoding happens entirely in your browser using the built-in encoder, so nothing you type is uploaded to a server and the tool keeps working offline.
Learn more
- What Base64 encoding is and when to use it
How Base64 turns bytes into safe ASCII, why the output grows by a third, and how base64url differs from the standard alphabet.
Related tools
Base64 Decode
Decode Base64 to plain text online. Paste a Base64 or base64url string and get instant UTF-8 output. Free, fast and runs in your browser.
URL Encoder
URL encode text online with percent-encoding. Escape spaces and reserved characters for a query value, or encode a full URL. Free and private.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.