Base64 encoder
Try Base64 Encoder
Loading calculator. If this message stays visible, enable JavaScript and reload.
Your result
The Base64 encoder converts pasted text into standard Base64 using its UTF-8 bytes. Enter the text and choose Calculate / Run. For example, MoneyOr becomes TW9uZXlPcg==. Spaces, punctuation and stored line breaks participate in the encoding, so an extra character can change the result.
Base64 is a reversible representation, not encryption. Use it when an interface requires bytes to be expressed as text, or when checking an encoding example during development. This form accepts text, uses UTF-8 and produces standard Base64. It does not upload binary files, choose legacy character encodings or automatically produce the URL-safe variant.
Encoding text with predictable bytes
How does the Base64 encoder turn text into output?
The Base64 encoder first converts the supplied JavaScript text value to UTF-8 bytes. It then encodes those bytes using standard Base64. The output represents the byte sequence rather than the visual appearance of the text. Two inputs that look similar can therefore produce different results if their actual characters or character composition differ.
The encoding is applied to the entire input as one value. A stored line break becomes part of the input bytes; it does not tell the tool to encode independent lines separately. The result has no automatically added MIME line wrapping, data-URI prefix or application-specific label. It is the encoded value alone.
For a quick check, compare a short known input with its expected output before using a larger passage. The Base64 decoder provides the reverse text operation for compatible UTF-8 content. A successful round trip checks the supplied value, but it does not establish that a different receiving system expects the same encoding convention.
How should I prepare text and verify the result?
- Confirm that the receiving interface requires standard Base64 of UTF-8 text.
- Keep an unchanged copy of the source.
- Paste the exact value into Text, replacing the sample.
- Choose Calculate / Run.
- Inspect the output and, if useful, decode it to check the original text.
- Copy the encoded value into the field that actually expects it.
Take particular care with whitespace. A leading space, trailing space or final newline belongs to the supplied value. The encoder does not trim them away. If your command-line tool, editor or source file adds a final line break, its encoded result can differ from a form input containing only the visible word.
A good comparison sample includes a letter with an accent, a space and a stored line break if those occur in the real data. An ASCII-only sample does not test how non-ASCII text becomes bytes. If you are comparing with another implementation, match the original characters and encoding settings before judging a different output as an error.
Paste plain text rather than an instruction or surrounding quotation marks, unless those marks are intentionally part of the value. The tool has no knowledge of which characters are content and which came from a copied explanation. Check the start and end of the field before running a value intended for an exact technical comparison.
Decide whether punctuation belongs to the data or its surrounding notation. Encoding a JSON string literal, including its quotation marks and escape characters, is different from encoding the string value it represents. The encoder does not parse JSON before processing. If your source is JSON, inspect its structure with the JSON formatter and identify the exact value the receiving interface requests.
Which checked examples explain the byte-to-text conversion?
Each row below is a separate input. The output was compared with an independent UTF-8 Base64 implementation. The byte counts show why a visible character count is not enough to predict the encoded length.
| Text input | UTF-8 bytes | Base64 output | Output characters |
|---|---|---|---|
M | 1 | TQ== | 4 |
Ma | 2 | TWE= | 4 |
Man | 3 | TWFu | 4 |
MoneyOr | 7 | TW9uZXlPcg== | 12 |
é, precomposed | 2 | w6k= | 4 |
😀 | 4 | 8J+YgA== | 8 |
The first three rows demonstrate output padding. Input lengths that are not a multiple of three bytes need padding in the final group. The equals signs are part of this standard output. Do not delete them merely because they look like extra punctuation; follow the receiving format's explicit rule.
For the same reason, the seven-byte MoneyOr example produces twelve encoded characters. The operation does not compress seven letters into fewer symbols. A receiving system may require this representation for compatibility, but the representation itself is not a file-size reduction method.
What determines encoded length and the input limit?
For this padded standard encoding, output length is 4 × ceil(n / 3), where n is the number of input bytes and ceil means round up to the next whole number. The result is measured in encoded characters. Use byte length after UTF-8 conversion, rather than the number of letters displayed on screen.
The engine accepts at most 2,000,000 UTF-8 input bytes. This is a byte limit, not a promise of two million arbitrary characters. A checked boundary input containing 2,000,000 ASCII a characters produces 2,666,668 encoded characters. Adding one more ASCII character triggers the tool's text-too-large error.
Non-ASCII input can reach the byte limit with fewer visible characters. The character counter can inspect character totals, but its count is not a substitute for measuring UTF-8 bytes. Use the file size converter only after obtaining an actual byte measurement when you need to express that size in another unit.
Do not split a value into arbitrary pieces and concatenate independently padded outputs as though they were always one encoding. Padding and group boundaries matter. If the complete input exceeds the form's limit, use an appropriate local encoding workflow rather than inventing a batching scheme that the receiver may not understand.
How are accents, emoji and line breaks handled?
The encoder uses UTF-8 without offering a character-set selector. The checked Hindi text नमस्ते occupies eighteen UTF-8 bytes and produces twenty-four Base64 characters. A single emoji can also occupy several bytes. The rule remains the same: first create bytes from the supplied text, then encode those bytes.
Character composition matters. A precomposed é encodes as w6k=, while an e followed by a combining acute accent encodes as ZcyB. They may look similar, but they are different text sequences. This form does not normalise them into one common spelling before encoding.
Line-ending conventions matter too. A line feed and a carriage-return-plus-line-feed sequence contain different bytes. The checked input A, a line feed and B encodes as QQpC. Browser textareas can normalise pasted line endings, so this text form should not be treated as a byte-preserving upload of an original file.
MDN's TextEncoder reference, checked in 2026, documents the UTF-8 conversion used for this stage. If a receiver expects a legacy encoding, choose a workflow that explicitly produces that encoding. A Base64 string alone does not include a label telling the receiver which character encoding preceded it.
A text field is also different from a raw byte editor. A character displayed with a particular numeric code is not necessarily encoded as one byte with that number. UTF-8 defines the bytes produced here. If you already have a binary byte sequence, pasting a visual representation of it does not reproduce those original bytes automatically. Use a byte-aware local workflow for that requirement.
What differs between standard Base64, Base64URL and other encodings?
This form produces standard Base64, including its ordinary alphabet and padding behaviour. Base64URL is a related variant with different characters for two alphabet positions and format-specific padding conventions. There is no Base64URL switch here. A result intended for a URL, token or filename must match that destination's exact requirements.
URL percent encoding is another operation. The URL encoder represents text for a URL component; it does not turn the underlying data into Base64. The HTML encoder escapes characters for an HTML-related context. Choose the operation requested by the receiving interface rather than combining encodings without a reason.
A data URI also needs more than this output. It includes a prefix identifying the type of content and encoding, followed by the data. This form does not determine a file's media type or create a complete image data URI. Pasting an image filename into Text encodes the filename's letters, not the image's contents.
When troubleshooting a mismatch, ask what the original bytes are, which variant is expected and whether surrounding transport encoding has already been applied. Those questions are more useful than repeatedly encoding an already encoded value. Each new encoding layer represents the previous output as fresh text.
Keep an example with the intended variant beside any integration test. Compare the full encoded string, including its case and final padding, rather than only a prefix. A partial match can hide a changed final newline or an incomplete copy. Successful encoding only confirms that the supplied text was transformed, not that the correct source value was selected.
Is Base64 useful for security, checksums or storing secrets?
Base64 does not provide secrecy. Anyone who receives the value can attempt to decode it. Do not use it as a password-protection method or assume that an encoded credential is safe to place in a public message. The change in appearance does not change the underlying sensitivity of the information.
If a sample must be shared, replace sensitive source values before encoding. Encoding first and editing only the visible output makes it harder to see what confidential material the sample still contains.
It is also not a checksum or a signature. A string that decodes successfully is not thereby authenticated, and the encoder does not verify where a value originated. Use the SHA-256 generator only for its separate digest task, with the understanding that a digest by itself is not an authenticated signature either.
For debugging, prefer a synthetic sample with the same relevant character structure as the real value. You can test Unicode, padding and whitespace without using live credentials or personal records. The result can then be shared as an example without revealing the confidential source you were trying to understand.
The same caution applies after decoding. Text can contain a URL, command or script-like content, but displaying or transforming it does not make it trustworthy. Treat a value according to its source and intended use. This encoder performs representation conversion, not malware analysis or content verification.
How do copying, reset and browser processing work?
The form is available without a tool account or fee in a modern browser. Copy result copies the displayed value and any result details. When pasting into a technical field, check that only the intended encoded value is present, without a heading, extra newline or surrounding prose from your destination.
Download CSV creates a result report, rather than a dedicated binary-file conversion. Save as baseline keeps a temporary comparison on the current page. Reset restores starting values and clears the current result. Keep the original source in your own document; those controls are not an archival backup.
The encoding operation runs in your browser. Website delivery, analytics and contact handling are separate from that transformation and are described in the MoneyOr privacy policy. Browser-side processing does not make an encoded secret suitable for publication. Use non-sensitive test values whenever possible.
Base64 encoder FAQs
Can I encode an image, PDF or archive here?
This form accepts pasted text and does not read a file's binary contents. Entering a filename encodes that filename as text. Use a file-aware encoder when you need the actual bytes of an image, PDF or archive, and confirm the receiving system's size and format requirements.
Why do two tools give different output for the same visible phrase?
Check the exact characters, final newline, surrounding spaces, character encoding and variant settings. The visible phrase alone may not reveal a different byte sequence. A controlled short sample with known whitespace is easier to compare than a passage copied through several applications.
Can I remove the equals signs before sending the result?
Only when the receiving format explicitly permits or requires that convention. This encoder produces padded standard output. Removing padding to make a value look shorter is not a general compatibility fix. Check the receiver's documented variant instead of changing characters by appearance.
Does encoding twice offer extra protection?
No. The second run merely encodes the first encoded string as another text value. A compatible decoder can reverse the layers. It adds representation steps, not confidentiality. Choose actual security controls for sensitive information rather than adding Base64 layers.
Can I encode several lines as separate entries?
This form treats the pasted input as one value, including its stored line breaks. It has no per-line encoding mode. Process separate entries deliberately or use a workflow that explicitly supports that structure; do not mistake a visual line wrap in the output for an independent encoded record.
Will the encoded output always be shorter than the input?
No. Standard padded Base64 expands the byte representation to groups of four encoded characters. It serves compatibility requirements rather than compression. Measure the actual payload and any later transport encoding if you need to assess storage or transfer size.
References and method
Sources reviewed on 14 November 2026: IETF, RFC 4648: The Base16, Base32, and Base64 Data Encodings, for encoding conventions; and MDN Web Docs, TextEncoder, for UTF-8 conversion. Examples and the byte-limit boundary were checked against MoneyOr's engine. Match the receiver's byte encoding and Base64 variant before using the result.