Base64 Encode

Text or a file into Base64, without mangling.

FREE · NO SIGN-UP · RUNS ON YOUR DEVICE

The file is read here, not sent

  • UTF-8bytes, not characters
  • 2alphabets
  • Anyfile, read locally
  • 0uploads
Specification

Base64 Encode at a glance

Direction
Encode, decode alongside
Text handling
UTF-8 bytes, not characters
Files
Files are read locally
Alphabets
Plus/slash, or minus/underscore
Size
About a third larger than input
Price
Free
Account required
None
Where it runs
On your device
How to

How to use Base64 Encode

  1. 1

    Set it to encode

    Switch the panel to encode.

  2. 2

    Add text or a file

    Type, paste, or choose a file.

  3. 3

    Pick the alphabet and copy

    Choose an alphabet, then copy.

Questions

Frequently asked questions

Why does my Chinese text come out broken elsewhere?

Because it was encoded from characters rather than UTF-8 bytes. Encoding here goes through UTF-8, so a round trip returns exactly what went in, emoji included.

When do I want the URL-safe alphabet?

When the result goes into a URL. It swaps plus and slash for minus and underscore and leaves the padding off, so nothing needs escaping.

Is my file uploaded to be encoded?

No. The file is read inside this browser tab and never leaves the device. Nothing is sent anywhere and nothing is stored.

Does encoding hide what I put in?

No. Base64 is an encoding and anyone can reverse it, including on this same panel. It makes bytes safe to carry as text and nothing more.

Background

What the encoded string is for

Set the switch to encode, then type, paste or choose a file. Text goes in as UTF-8 bytes, and the alphabet can be standard or URL-safe.

  • Encoding carries bytes through anything that only accepts text, such as a JSON field or a mail attachment.
  • The output grows by roughly a third, so large files make long strings that are awkward to paste.
  • Trailing equals signs are padding, and the URL-safe form generally drops them.
  • A data URL puts the encoded string after the comma, which is the part that matters when you copy one.

Full specification

Specification of the Base64 Encode tool
DirectionEncode, with decode on the same switch when you want to check the result.
Text handlingEncoded as UTF-8 bytes, so Chinese, accents and emoji come back identical on the way out.
FilesAny file can be encoded. It is read inside this tab and is never uploaded.
AlphabetsStandard, using plus and slash, or URL-safe, using minus and underscore.
SizeBase64 output runs about a third longer than the input, so it fits small files better than large ones.
PriceFree. Supported by clearly labelled ads placed outside the working area.
Account requiredNo.
Where it runsIn your browser tab. Nothing is sent anywhere.
Next step

Keep going with the same files

All developer tools: Developer tools on SPOTTOOLS