Base64 Encoder
Base64 encode any text, with UTF-8, URL-safe and line-wrap options.
- Text
- 39 bytes (UTF-8)
- Base64
- 52 characters
Text
Base64
How to encode text to Base64
- Type or paste your text on the left, or open a text file.
- The Base64 appears on the right as you type. Turn on URL-safe for URLs, file names and JWTs, or Wrap at 76 for email and PEM files.
- Copy the result or Download it as a .txt file.
Base64 encoding examples
Hello, world!
→ SGVsbG8sIHdvcmxkIQ==Grüße
→ R3LDvMOfZQ==
👋
→ 8J+Riw==👋
→ 8J-RiwHow Base64 encoding works
Base64 turns any bytes into 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes (24 bits) are split into four 6-bit groups, and each group becomes one character. If the input doesn't divide into groups of three, = pads the end. Text is first converted to UTF-8, so a character such as ü (2 bytes) or 👋 (4 bytes) encodes correctly — unlike JavaScript's btoa(), which throws an error on it.
Typical uses: HTTP Basic authentication headers, embedding small files in JSON or XML, email attachments (MIME), and data URIs in HTML and CSS. Base64 is not encryption — anyone can decode it.
Other Base64 tools
Turn Base64 back into text with the Base64 decoder. To embed a picture, the image to Base64 converter creates a ready-made data URI, and Base64 to image previews one. Inspecting a token? The JWT decoder decodes its Base64url parts for you.
Frequently asked questions
- Is the encoder UTF-8 safe?
- Yes. Text is converted to UTF-8 bytes before encoding, so accents, umlauts, Chinese characters and emoji all work: “Grüße” becomes “R3LDvMOfZQ==”. The browser’s built-in btoa() fails on such text; this tool does not.
- What is URL-safe Base64?
- A variant (RFC 4648 §5) that replaces + with - and / with _ and leaves out the = padding, so the result can go into URLs, file names and JWTs without escaping.
- Why wrap lines at 76 characters?
- MIME email and PEM files traditionally break Base64 into lines of at most 76 characters. Most other uses — JSON, data URIs, HTTP headers — need it on one line, so wrapping is off by default.
- Why is the Base64 longer than my text?
- Base64 turns every 3 bytes into 4 characters, so the output is about a third larger. Characters outside ASCII take 2–4 bytes in UTF-8, which makes the output grow further.
- Is Base64 encryption?
- No. Base64 is an encoding: anyone can decode it without a key. Use it to transport data safely as text, never to hide passwords or secrets.