Developer Tools

Base64 Encoder & Decoder

Encode text or files to Base64 and decode it back, with UTF-8 and URL-safe support, entirely in your browser.

By Nitin Raturi · Last reviewed

Input

How to use the Base64 Encoder & Decoder

Convert text or files to Base64 and back, entirely in your browser.

  1. Choose Encode or Decode.
  2. Paste your text, or choose a file to encode.
  3. For encoding, pick the alphabet and whether to add padding.
  4. Copy the result. Decoded binary data can be downloaded as a file.

Good to know

  • Tap the ⓘ next to any field for a short guide to it.
  • Nothing you paste or choose is uploaded or saved in the link.

Base64 turns bytes into 64 safe characters (RFC 4648). Text is read as UTF-8.

Runs in your browser. Nothing you type is uploaded or saved in the link.

Mode

Encode turns text or a file into Base64. Decode turns Base64 back into text or bytes.

How to fill it in

  • Choose Encode or Decode. Decode detects the standard and URL-safe alphabets by itself.

Text

In encode mode, the text to turn into Base64. In decode mode, the Base64 to turn back into text.

How to fill it in

  • Paste or type. Text is encoded as UTF-8, so ₹ and Hindi letters work.
  • When decoding, spaces and line breaks are ignored.

Example

“Hello, ₹ world” encodes to SGVsbG8sIOKCuSB3b3JsZA==.

Keep in mind: Base64 is not encryption. Anyone can decode it, so never use it to hide secrets.

Or encode a file

Choose a file to encode its bytes, for example to embed a small image as a data URL.

How to fill it in

  • Files up to 10 MB. The file is read in your browser and never uploaded.

Alphabet

Standard Base64 uses + and /. The URL-safe variant uses - and _ so the result can go in links and file names.

How to fill it in

  • Use URL-safe for JWTs, URLs and file names. Use standard for email and data URLs.

Example

URL-safe without padding, the sample is SGVsbG8sIOKCuSB3b3JsZA.

Add = padding

Padding adds = signs so the length is a multiple of 4.

How to fill it in

  • Keep it on for standard Base64. JWTs and many URL uses leave it off.

Result

Input
16 bytes
Base64
24 characters

Base64

SGVsbG8sIOKCuSB3b3JsZA==

How this calculator works

  1. Step 1Text to bytesUTF-8Each character becomes one to four bytes.
  2. Step 2Regroup the bits3 bytes → 4 groupsEvery 24 bits are split into four groups of 6 bits.
  3. Step 3Look up each group64 charactersEach 6-bit number picks one letter, digit or symbol.

Base64 lets binary data travel through systems that only accept plain text, such as email, JSON and data URLs. It makes data about a third larger.

Worked example: encoding “foo”

The three bytes of “foo” become exactly four Base64 characters: Zm9v.

Encoding “foo” (RFC 4648 test vector)
Bytes in binary
01100110 01101111 01101111
  1. 6-bit group 1011001 = 25
  2. 6-bit group 2100110 = 38
  3. 6-bit group 3111101 = 61
  4. 6-bit group 4101111 = 47
  5. Look up 25, 38, 61, 47 in the alphabetZ, m, 9, v
  6. Base64Zm9v

When the input is not a multiple of 3 bytes, the last group is filled with zero bits and “=” signs pad the result to a multiple of 4 characters.

Reading the result

  • StandardSGVsbG8sIOKCuSB3b3JsZA==Uses + and /, with = padding. For email, data URLs and most APIs.
  • URL-safeSGVsbG8sIOKCuSB3b3JsZAUses - and _ and usually no padding. For links, file names and JWTs.

When you decode, the tool detects which alphabet was used. If the bytes are not valid text, it shows a hex preview and lets you download them.

  • Not encryptionAnyone can decode Base64. It hides nothing.
  • About 33% largerEvery 3 bytes become 4 characters.
  • Line breaks ignoredWrapped Base64, as in email, decodes normally.
  • UTF-8 textCharacters such as ₹ use more than one byte.

Base64 makes bytes safe for text. URLs and tokens use related encodings.

For text in links and query strings, use the URL encoder and decoder. A JWT’s parts are Base64URL-encoded JSON, which the JWT decoder reads, and the hash generator fingerprints any text or file.

Common mistakes

  • Mistake: Using Base64 to protect passwords or keys.

    Instead: Use real encryption; Base64 is only an encoding.

  • Mistake: Putting standard Base64 in a URL.

    Instead: Use the URL-safe alphabet, or + and / will break the link.

  • Mistake: Decoding with a tool that reads text as Latin-1.

    Instead: Decode as UTF-8 so ₹ and Indian scripts survive.

Read how we test our calculators, or browse more developer tools.

Frequently asked questions

Is Base64 a form of encryption?

No. Base64 is an encoding that anyone can reverse. Never use it to hide passwords, keys or personal data.

What is the difference between standard and URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant uses - and _ instead and usually drops the = padding.

Why does my Base64 end with = signs?

Padding makes the length a multiple of 4 when the input is not a multiple of 3 bytes. One = means one byte short, two means two bytes short.

Does it handle ₹ and Indian languages?

Yes. Text is converted to UTF-8 bytes before encoding and decoded as UTF-8, so every character survives.

Is my file uploaded?

No. The file is read by your browser and encoded on your device. Nothing is sent to a server or saved in the link.

Sources and methodology

The formulas are standard time-value-of-money results. We check every figure against golden values worked out independently, by closed form and by month-by-month simulation; see the methodology.

Written and maintained by Nitin Raturi, a software engineer (about the author). Last reviewed 27 Oct 2026; next review due by . Found an error? Tell us.

Changelog

  • : Initial release. Demand metrics remain unverified.