Loading tool...

How to Convert String to Base64 - Step by Step Guide

Step 1

Enter Your Text

Start by typing or pasting your plain text string into the input area that you want to encode to Base64.

•
Type or paste: Enter any text you want to encode
•
Any language: accents, emoji and non-Latin scripts are encoded as UTF-8
•
Try sample: Click "Sample" to test with example text
Step 2

Automatic Encoding

There is no button to press. About a second after you stop typing, the text is encoded to standard Base64 and shown on the right. The Sample text becomes QmFuZHdpZHRoOiA1MDBNYnBzIG9uIFRvd2VyIDVHLTAwMQ==.

•
Updates on its own: the output follows your edits
•
RFC 4648 compliant: Standard Base64 encoding
•
Standard alphabet: uses + and / with = padding, so percent-encode it before putting it in a URL
Step 3

Copy or Download Result

Once encoded, you can copy the Base64 string to your clipboard or download it for use in your projects.

•
Copy to clipboard: One-click copying for quick use
•
Download output: saves the Base64 as encoded-base64.txt
•
Check it: the Reverse button opens Base64 to String in a new tab, so you can decode the result and compare

What is String to Base64 Encoding?

String to Base64 encoding converts plain text into Base64 format, enabling safe transmission through REST APIs, HTTP headers, and email systems.

The browser's own btoa() function only understands Latin-1, so this page first turns your text into UTF-8 bytes and encodes those. That is what servers, command-line tools and most programming languages expect, so Unicode text like "José 😀" decodes back correctly on the other end.

Frequently Asked Questions

How do I encode a string to Base64?

Type or paste your text on the left. About a second after you stop typing, the Base64 version shows up on the right, ready to copy or download as a .txt file. Copy and Download always use what is in the editor at that moment.

Why encode strings to Base64?

Base64 turns any text into plain ASCII letters, digits, + and /, so it can pass through systems that only expect ASCII: HTTP Basic auth headers, data: URIs, JSON or XML fields that must not contain line breaks, and environment variables or Kubernetes secrets.

How are accents, emoji and other non-English characters handled?

The text is turned into UTF-8 bytes first and those bytes are encoded, the same as base64 on Linux or Buffer.from(text).toString("base64") in Node.js. So "José 😀" becomes Sm9zw6kg8J+YgA== and decodes back to exactly the same text anywhere that reads UTF-8.

Is the output safe to put in a URL?

Not directly. This is standard Base64 (RFC 4648) with + and / and = padding. In a URL, either percent-encode it or swap + for - and / for _ and drop the padding if the receiving side expects the URL-safe variant.

Is my text sent anywhere?

No. Encoding runs in your browser with JavaScript and the page makes no request with your text. Keep in mind that Base64 is an encoding, not encryption: anyone who has the output can decode it, so it does not hide passwords or keys.

Is there a size limit?

There is no fixed limit, but everything happens in your browser tab, so very large inputs (tens of megabytes) get slow in the editor. The output is about a third bigger than the UTF-8 size of your text.