Text to Base64 Converter — Free, Browser-Based | SmallStudyTools
100% Free · No Signup · Browser-Based

Text to Base64 Converter

Type or paste any text and get a Base64-encoded string, right in your browser — nothing is uploaded to a server. Pro Mode adds URL-safe encoding, line wrapping, splitting into multiple files, a data URI prefix, and a real Base64-to-text decode mode.

● Pro Version is Free for now
✓ URL-safe encoding, line wrapping & data URI prefix ·
✓ Split into multiple files · ✓ Decode Base64 back to text
Day Night
📝 Your Text
0 characters · 0 words
🎉 Your Base64 Output
🔄 Decode Mode PRO
Decode Base64 → Text
Off by default · treat the input box as Base64 and decode it back to plain text
🔗 Output Format PRO
URL-safe encoding
Off by default · replaces +/ with -_ and drops = padding
📎 Data URI Prefix PRO
Add data: URI prefix
Off by default · prepends data:text/plain;base64, — paste straight into an href or src
📏 Line Wrapping PRO
✂️ Splitting PRO
Split into multiple files
Off by default · put a line with only --- between parts

How to Use the Text to Base64 Converter

From typed or pasted text to a Base64-encoded string in seconds. No signup, and your text never leaves your browser.

1
Type, Paste, or Upload
Type directly into the text box, paste in any text, or click Upload .txt File to load an existing plain-text file. A live counter tracks characters and words as you go.
2
Base64 Output Builds Instantly
Click Convert to Base64 and your text is UTF-8 encoded and turned into a real Base64 string, right in your browser, ready to copy or download.
3
Switch to Pro Mode
Unlock URL-safe encoding, a data: URI prefix, line wrapping, splitting one block of text into multiple files, and a real Decode Mode that turns Base64 back into plain text.
4
Check the Output Length
Each result shows its input character count, output character count, and file size, so you can confirm the encoded string is exactly what you expect before downloading.
5
Download or Copy
Copy the result straight to your clipboard, download it as a .txt file, or — if Splitting is turned on — grab every part at once as a .zip.

Everything above runs entirely in your browser. The text you type, paste, or upload is never sent to a server, so its contents stay completely private from start to finish.

Specifications
Price Free
Signup Not Required
Data Processing Local only, in your browser
Output Format Base64-encoded text (.txt)
Input Type Typed/pasted text or .txt upload
Text Limit 2,000,000 characters (soft cap) · up to 20 split parts in Pro
Pro Mode Options Decode Mode, URL-Safe Encoding, Data URI Prefix, Line Wrapping, Splitting into Multiple Files
Found a bug or something not working right? Let us know and we'll fix it, every report helps make this tool better.
Report an Issue

Text to Base64 Converter: Encode Plain Text Into Base64, and Decode It Back

Quick answer: Type or paste your text above, or upload a .txt file, and this tool encodes it into a real Base64 string, free and entirely in your browser. Pro Mode adds URL-safe encoding, a data URI prefix, line wrapping, splitting one block of text into multiple files, and a genuine Decode Mode that turns Base64 back into plain text.

Base64 is a way of representing arbitrary bytes, letters, numbers, punctuation, emoji, anything, using only 64 printable characters: A through Z, a through z, 0 through 9, plus two more symbols and an = padding character. It exists because a lot of systems, old email protocols, JSON fields, URL query strings, config files, were only ever designed to safely carry plain, printable ASCII text, not arbitrary binary data or certain punctuation. Converting text to Base64 turns it into a string that will survive being copied, pasted, emailed, or embedded somewhere without any character in it being misread, stripped, or corrupted along the way.

This tool's natural starting point is the text box itself: you type or paste directly into it, and a live counter tracks characters and words as you go. Uploading a .txt file is available as a convenience, checked by its actual decoded bytes rather than just its file extension, but pasting straight into the box is the primary, fastest path for most of what people convert here. Every option below, encoding or decoding, runs entirely as JavaScript in your own browser tab; nothing you type is ever sent anywhere.

1How This Text to Base64 Converter Works

Once you click Convert to Base64, the tool first encodes your text as raw UTF-8 bytes using the browser's built-in TextEncoder, the same correct, standards-based approach used internally by web browsers and virtually every modern programming language, so accented letters, East Asian text, emoji, and other multi-byte Unicode characters are handled properly rather than mangled. Those bytes are then grouped three at a time and mapped onto the 64-character Base64 alphabet defined in RFC 4648, the official internet standard for Base64 encoding, with = padding added at the end if the final group doesn't divide evenly by three. The result is a genuine Base64 string built directly in your browser, ready to copy, download, or drop straight into wherever it needs to go.

2Simple vs Pro Mode

FeatureSimplePro
Encode typed or pasted text into Base64✓✓
Upload a .txt file to load text into the box✓✓
Live character & word counter✓✓
Decode Mode — turn Base64 back into real text—✓
URL-safe encoding (-/_, no padding)—✓
Data URI prefix (data:text/plain;base64,)—✓
Line wrapping — 64 or 76 characters per line—✓
Split one block of text into multiple outputs, download as ZIP—✓

Simple Mode covers the everyday case: paste in text and get back a single, unwrapped, standard Base64 string, no decisions required. Pro Mode, currently free to use, hands over the full toolkit that a developer or power user actually reaches for: a real decoder, URL-safe output, a ready-to-embed data URI, line wrapping, and splitting a long paste into several separate results.

3Decode Mode: A Real Base64-to-Text Decoder, Not Just an Encoder

A tool that only encodes text is only solving half the problem, since Base64 only becomes useful once something on the other end can turn it back into the original text. Turning on Decode Mode in Pro Mode repurposes the same input box: instead of typed text, it now expects Base64, and clicking Decode to Text runs the encoding process in reverse. The decoder is built to be genuinely robust rather than fragile: it automatically strips a data:...;base64, prefix if one is present, ignores line breaks and whitespace from wrapped or multi-line input, auto-detects and normalizes both the standard and URL-safe alphabets so you never have to tell it which one you used, and re-adds any missing = padding before decoding. If what's pasted in genuinely isn't valid Base64, or the decoded bytes don't form valid UTF-8 text, the tool shows a specific, honest error rather than silently producing garbage or a blank result, and when Splitting is also on, each ----separated part is decoded and reported on independently, so one bad part never blocks the good ones.

4URL-Safe Encoding and the Data URI Prefix: Two Genuinely Different Output Formats

Two Pro options exist specifically to change what the output string is actually made of, not just how it looks. URL-safe encoding replaces the standard alphabet's + and / characters with - and _, and drops the trailing = padding entirely, exactly as defined by RFC 4648's own Base64URL variant. That matters because a standard Base64 string containing a raw + or / can be silently corrupted or misinterpreted the moment it's dropped into a URL path, a query string parameter, or a filename, so URL-safe output is the version meant for exactly those contexts. The data URI prefix option does something different: it prepends the literal string data:text/plain;base64, to the front of the encoded output, matching the real RFC 2397 data URI scheme that browsers already understand natively. The result can be pasted directly into an HTML href or src attribute, or a CSS url() value, and used immediately as a self-contained, embeddable resource with no separate assembly step. Because a data URI is meant to be used as a single unbroken value, turning it on automatically overrides line wrapping for that output, keeping the string valid and usable exactly as generated.

5Common Reasons People Convert Text to Base64

🔐
Building HTTP Basic Auth Headers
🧩
Embedding Config Values or Secrets in JSON/YAML
🔗
Passing Text Safely Inside a URL Parameter
📧
Encoding Content for Older Email (MIME) Systems
🎨
Inlining Small Text or SVG Assets as a Data URI
🧪
Debugging or Sanity-Checking an Existing Base64 Value

Base64 shows up anywhere a system needs to guarantee that a piece of text will survive intact through a channel that wasn't built to carry every possible character safely, an authentication header, a URL, an older text-only email format, or a JSON config file that shouldn't contain raw special characters. Decoding is just as common a need in practice: pulling apart an API token to see what's really inside it, checking a value pasted from documentation, or confirming that an encoded string in a log file matches what you expect, which is exactly what this tool's Decode Mode is built for.

6Line Wrapping and Splitting One Block of Text Into Several Files

Two remaining Pro options give you control over the shape of the output rather than its content. Line wrapping breaks a long Base64 string into fixed-width lines, either 76 characters, the classic width used by MIME email encoding, or 64 characters, another common convention, instead of one continuous unbroken line; this is purely cosmetic and doesn't change the decoded value at all, wrapped or unwrapped Base64 decodes to exactly the same text once whitespace is stripped, which this tool's own decoder does automatically. Splitting works on the input side instead: placing a line containing only three dashes (---) between sections of your original text tells the converter to treat each section as an independent block, encoding every one separately, up to 20 at once, each downloadable on its own or all together as a single ZIP file. The same --- convention works in reverse in Decode Mode, letting you decode several separate Base64 blocks back into their original text in one pass.

Privacy Note

Every word you type, paste, or load from a .txt file, in either direction, encoding or decoding, is processed entirely inside your own browser tab using JavaScript running on your device. Nothing is uploaded, stored, or transmitted to a server at any point, whether you're in Simple Mode or Pro Mode.

7Frequently Asked Questions

Is there a free way to convert text to Base64?
Yes. Type or paste your text into the box above, or upload a .txt file, and it becomes a real Base64-encoded string right in your browser, in a fraction of a second. There's no account to create, no watermark, and no limit on how many times you can use it, since the whole conversion happens on your own device.
Can this tool decode Base64 back into text, not just encode it?
Yes, in Pro Mode. Turn on Decode Mode and the same input box now accepts Base64 instead of plain text: paste it in, click Decode to Text, and the tool reverses the exact same UTF-8 encoding process to hand back your original text. It automatically detects and accepts both standard and URL-safe Base64, auto-strips a data: URI prefix if one is present, and shows a clear error if what you pasted isn't valid Base64 or doesn't decode to valid UTF-8 text.
What is URL-safe Base64 encoding, and when do I need it?
Standard Base64 uses the characters + and /, both of which have special meaning inside a URL, plus trailing = padding. URL-safe Base64, available in Pro Mode, replaces + with - and / with _, and drops the = padding entirely, so the resulting string can be dropped directly into a URL path, a query parameter, or a filename without needing any extra encoding or escaping.
What does the data URI prefix option actually do?
Turning on Data URI Prefix in Pro Mode prepends the real string data:text/plain;base64, to the front of your encoded output, exactly matching the RFC 2397 data URI format browsers expect. That means the result can be pasted directly into an href, an src attribute, or a CSS url() and used immediately, with no separate assembly step.
How do I convert one block of text into several separate Base64 files?
Turn on Splitting in Pro Mode, then put a line containing only three dashes (---) between each section of your text. Each section is encoded into its own Base64 output, up to 20 at once, and you can download them individually or grab all of them together as a single ZIP file.
Does this tool handle accented letters, emoji, and other non-English characters correctly?
Yes. Text is first encoded as UTF-8 bytes before Base64 encoding is applied, which is the correct, standards-based way to handle any Unicode character, including accented letters, CJK text, and multi-byte emoji. Decoding reverses the exact same process and will show a clear error rather than garbled output if the decoded bytes ever turn out not to be valid UTF-8.

Built on open standards. The Base64 alphabet, padding rules, and the URL-safe variant this tool implements follow RFC 4648, "The Base16, Base32, and Base64 Data Encodings", the official IETF standard first published in 2006. The optional data URI prefix follows RFC 2397, "The data URL scheme", the standard that defines how browsers interpret a data: URI directly in markup.

Lilly
Here to help you find a tool
Search tools Search blogs
Try me to find a tool! 👋