Skip to content

Base64 Encoder & Decoder

Encode text to Base64 or decode it back, with full UTF-8 support and a URL-safe option. You can also turn a file of up to 10 MB into Base64 or a data URL.

  • Free, no sign-up
  • Runs in your browser
  • Developer
Encode or decode text
Mode
Up to 1,000,000 characters. Text is encoded as UTF-8. When decoding, standard and URL-safe Base64 are both recognized, with or without padding.

Encode a file
Any file up to 10 MB. It is read on your device and never uploaded.
Output format

Read the guide What Is Base64 Encoding and How Does It Work?

How to use the Base64 tool

Text

  1. Choose Encode or Decode.
  2. Type or paste your text. The result updates as you type.
  3. When encoding, tick URL-safe output if the result will go into a URL or a file name.
  4. Press Copy, or Use result as input to reverse the operation and check the round trip.

When decoding, standard and URL-safe Base64 are both recognized automatically, with or without the = padding. Spaces and line breaks are ignored, and a leading data URL prefix such as data:text/plain;base64, is removed for you.

Files

Choose a file of up to 10 MB and pick the output: plain Base64, URL-safe Base64 or a complete data URL that you can paste into HTML or CSS.

Your text and files stay on your device

Encoding and decoding happen in your browser. Files are read locally and are never uploaded to our server.

How Base64 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 does not divide evenly by 3, the output is padded with one or two = signs.

Text is first converted to bytes with UTF-8, so accented letters, other alphabets and emoji all work correctly.

Worked example

The word Café is 5 bytes in UTF-8, because é takes two bytes (C3 A9). Five bytes need two groups of three, so the output is 8 characters with one padding sign: Q2Fmw6k=.

The text Hi?> encodes to SGk/Pg==. The URL-safe version replaces / with _ and + with -, and drops the padding: SGk_Pg.

Good to know

  • Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
  • The output is about 33% larger than the input: 4 characters for every 3 bytes.
  • If valid Base64 decodes to bytes that are not UTF-8 text, the tool tells you instead of showing garbled characters. Such data is usually a binary file like an image.
  • Data URLs are convenient for small icons, but large files are better served as normal files.

Frequently asked questions

Why do some characters break other Base64 tools?

Older methods in browsers only handle characters in the Latin-1 range and fail on emoji or non-Latin scripts. This tool converts text to UTF-8 bytes first, so every Unicode character encodes and decodes correctly.

What is URL-safe Base64?

It is a variant defined in RFC 4648 that uses - and _ instead of + and /, because those two characters have special meanings in URLs. The trailing = padding is usually left out as well. JSON Web Tokens use this form.

Is Base64 a secure way to protect data?

No. Base64 only changes how the data is written, and anyone can reverse it in a second. Use real encryption if the data must stay private.

Why is there a 10 MB file limit?

The encoded result is about 13.3 MB of text for a 10 MB file, which is already a lot for a browser text box. For larger files a command-line tool is a better choice.

Are my files uploaded?

No. The file is read by your browser and encoded on your device. Nothing is sent to our server.