Text to Base64 Converter
Encode any text, including emoji and accents, into a Base64 string.
Encoders & Decoders Runs in your browser
How do you convert text to Base64?
Need an ASCII-safe version of a string for a data URI, HTTP header or JSON field? This encoder converts text to UTF-8 bytes, then maps every 3 bytes to 4 characters from the RFC 4648 alphabet, padding with = when the length is not a multiple of three. “Hello” becomes “SGVsbG8=”, and a four-byte emoji encodes just as cleanly as plain ASCII.
How to use the Text to Base64
- 1 Enter the text you want encoded — anything from a word to a whole document.
- 2 The output pane fills with standard Base64: the + / alphabet with = padding.
- 3 Feed it back through the Base64 to Text tool if you want to verify the round trip.
- 4 Copy the encoded string into your header, URI or fixture.
What you can use it for
- Embedding text inside a data URI.
- Creating Base64 test values for an API.
- Encoding small payloads for transport in JSON.
- Obfuscating a short string for display.
Frequently asked questions
Why does my text get UTF-8 encoded first?
Base64 operates on bytes. UTF-8 is the step that turns characters into bytes: “é” becomes two bytes, most emoji four. Skipping it (as a raw btoa call does) throws on anything outside Latin-1.
Is this standard or URL-safe Base64?
Standard alphabet per RFC 4648 section 4: +, / and = padding. If the value goes into a URL or a JWT, substitute - and _ yourself or percent-encode the result.
Can I decode it again?
Yes, and the round trip is lossless. The companion Base64 to Text page reverses the exact transform, byte for byte.
Related tools
More Encoders & Decoders
More tools like this:
All Encoders & Decoders