Text to Base64 Converter

Encode any text into clean Base64 instantly.

Text to Base64 Converter

Text to Base64 Converter turns plain text into Base64, the text-safe format used by email attachments, data URIs and web tokens.
Encoding happens live as you type, works with every language and emoji,
and nothing you paste ever leaves your device!


Load an example

Copy Download
characters
Input: 0 characters (0 UTF-8 bytes) | Output: 0 characters
Ready to encode text to Base64.


Introduction:

Our Text to Base64 Converter is a free, browser-based utility that encodes any text into Base64 format. Paste your text into the input box and the encoded result appears immediately in the output box - no buttons to press, no waiting, no limits.

The tool runs entirely in your browser. Your text is never uploaded to a server, which makes it safe for snippets, configuration values or anything else you would rather not share. You can also use Base64 to Text Decoder to convert Base64 text to simple readable text.


What Is Base64 Encoding?

Base64 is a binary-to-text encoding defined in RFC 4648. It represents any data using only 64 safe printable characters: A-Z, a-z, 0-9, + and /, with = reserved for padding. The name comes from its arithmetic: every 3 bytes (24 bits) of input are split into four 6-bit groups, and each group is looked up in the 64-character alphabet.

A classic example: the word Man becomes TWFu. When the input length is not a multiple of three, the last group is completed with = padding characters — two bytes leave one trailing = (as in HiSGk=) and one byte leaves two (HSA==). That is why so many Base64 strings end with an equals sign.

One important thing to remember: Base64 is encoding, not encryption. It changes how data looks so that it can travel through text-only channels such as email or JSON; it does not hide or protect anything. Anyone can decode a Base64 string back to the original text.


What This Tool Does?

Live Conversion: The output updates on every keystroke. You can also click "Convert to Base64" after uploading a file or using "Load an example".

Correct UTF-8 Handling: Accented letters, emoji, Bangla, Japanese and every other script are converted to their proper UTF-8 bytes before encoding, exactly as the standard requires. Naive converters break here; this tool does not.

Example: Café encodes as Q2Fmw6k= — the é becomes the two UTF-8 bytes C3 A9.

Line Wrapping: The result is folded into lines of a fixed width straight away — 70 characters by default. Change the width to anything you need, or untick "Wrap output into lines" for one continuous piece. The traditional MIME value used in email is 76.

Example: Wrapped at 76 characters, the paragraph in Example 5 below folds into five neat lines; untick the option and the very same input comes out as a single continuous string.

URL-Safe Alphabet (Optional): Standard Base64 can contain + and /, which have special meanings in URLs. Ticking "URL-safe alphabet" swaps them for - and _ (RFC 4648 §5), the variant used by JWTs.

Example: Standard PDw/ becomes URL-safe PDw_.

Padding Removal (Optional): Tick "Remove trailing = padding" to strip the closing = characters for compact tokens. Many modern systems accept unpadded Base64; some older ones require the padding.

File Upload, Copy & Download: Load a .txt file instead of typing, copy the result to your clipboard with one click, or download it as a file.

Live Statistics: Character counts and UTF-8 byte sizes update as you type, including how much larger the output is than the input — Base64 always adds roughly a third (four output characters per three input bytes).


Examples:

Click Try it on any example below to load it straight into the tool. Each example also switches on the options it demonstrates, and the text on the right is the exact output the tool produces.

Example 1: Plain English sentence
Input
Hello, world! Welcome to TextToolz.
Output (Base64, one piece)
SGVsbG8sIHdvcmxkISBXZWxjb21lIHRvIFRleHRUb29sei4=
Example 2: URL with a query string (URL-safe mode)
Input
https://text-toolz.com/search?q=case converter&page=2
Output (URL-safe, padding removed)
aHR0cHM6Ly90ZXh0LXRvb2x6LmNvbS9zZWFyY2g_cT1jYXNlIGNvbnZlcnRlciZwYWdlPTI

Notice the _ where standard Base64 would have a / — safe to drop into a URL parameter or token.

Example 3: JSON payload
Input
{"user":"razib","role":"editor","id":42}
Output (Base64, one piece)
eyJ1c2VyIjoicmF6aWIiLCJyb2xlIjoiZWRpdG9yIiwiaWQiOjQyfQ==

This is exactly how the payload part of a JWT is prepared before signing.

Example 4: Unicode in many languages & emoji
Input (51 characters, 103 UTF-8 bytes)
Café ☕ – Grüße, नमस्ते, España – বাংলা টেক্সট – 日本語
Output (Base64, one piece)
Q2Fmw6kg4piVIOKAkyBHcsO8w59lLCDgpKjgpK7gpLjgpY3gpKTgpYcsIEVzcGHDsWEg4oCTIOCmrOCmvuCmguCmsuCmviDgpp/gp4fgppXgp43gprjgpp8g4oCTIOaXpeacrOiqng==

Spanish (España), German (Grüße), Hindi (नमस्ते), Bangla, Japanese and an emoji in one line: 51 characters become 103 UTF-8 bytes, and the statistics panel shows the true size increase.

Example 5: Long paragraph wrapped at 76 characters
Input
Base64 is everywhere on the web, from email attachments to data URIs and web tokens. Because it maps every three bytes of data onto four printable characters, the encoded result travels safely through systems that only understand plain text.
Output (wrapped, 76 characters per line)
QmFzZTY0IGlzIGV2ZXJ5d2hlcmUgb24gdGhlIHdlYiwgZnJvbSBlbWFpbCBhdHRhY2htZW50cyB0
byBkYXRhIFVSSXMgYW5kIHdlYiB0b2tlbnMuIEJlY2F1c2UgaXQgbWFwcyBldmVyeSB0aHJlZSBi
eXRlcyBvZiBkYXRhIG9udG8gZm91ciBwcmludGFibGUgY2hhcmFjdGVycywgdGhlIGVuY29kZWQg
cmVzdWx0IHRyYXZlbHMgc2FmZWx5IHRocm91Z2ggc3lzdGVtcyB0aGF0IG9ubHkgdW5kZXJzdGFu
ZCBwbGFpbiB0ZXh0Lg==

Common Use Cases:

Email Attachments (MIME): Email was designed for text, yet people send images and documents every day. MIME wraps binary files in Base64 lines of 76 characters so they survive the journey intact.

Data URIs: Small images, fonts and icons embedded directly in HTML or CSS use data: URLs whose payload is Base64. Encoding a short SVG or favicon by hand starts right here.

Web Tokens (JWT): JSON Web Tokens encode their header and payload with the URL-safe Base64 variant, which is why JWT segments contain - and _ but no +, / or =.

HTTP Basic Authentication: The Authorization: Basic header carries username:password joined together and Base64-encoded — try entering your credentials in that format to see what the header contains.

Safe Storage in Text Formats: Configuration files, cookies, XML and JSON prefer plain text. Base64 lets binary or tricky values ride along without breaking quotes, escapes or line endings.


FAQs:

FAQ 1: Is Base64 encryption?
Answer: No. Base64 is an encoding, not encryption. It converts text into a different representation so it can pass through text-only systems; anyone can reverse it. Never rely on Base64 to protect secrets.

FAQ 2: Why does my Base64 output end with one or two equals signs?
Answer: Base64 processes input in groups of 3 bytes. If the last group has only 2 bytes, one = is appended; if it has only 1 byte, two are appended. The padding keeps the output length a multiple of 4. You can remove it with the "Remove trailing = padding" option when the receiving system allows it.

FAQ 3: Why is the Base64 output about a third larger than my input?
Answer: Every 3 bytes of input become 4 characters of output, so the size grows by roughly 33%. The statistics panel shows the exact percentage for your text, including the extra bytes that multi-byte characters contribute.

FAQ 4: When should I use the URL-safe alphabet?
Answer: Whenever the encoded value will travel inside a URL, filename or token where + and / could be misinterpreted. The URL-safe variant replaces them with - and _, and is required by the JWT standard.

FAQ 5: Does the tool work with Spanish, Hindi, Bangla, emoji and other non-Latin scripts?
Answer: Yes. The tool converts your text to UTF-8 first, then encodes those bytes, which is the standards-compliant way to Base64-encode any script. Example 4 above shows Spanish, German, Hindi, Bangla and Japanese alongside an emoji, all encoded correctly.

FAQ 6: Is my text sent to a server?
Answer: No. The conversion runs entirely in your browser with JavaScript, and nothing you paste or upload is stored anywhere.

TextToolz

The Ultimate Text Tools

TextToolz works seamlessly to let you convert and design your text. It is fast, reliable and secure. Trusted by thousands of users.