Free Base64 Encoder

This Base64 encoder turns text into Base64 as you type, or encodes files up to 50 MB in File Upload mode. It runs in your browser, so nothing is uploaded. To go the other way, use the Base64 decoder.

Encoding Mode
Input: 0 characters (0 bytes as UTF-8)Encoded as UTF-8
Output: 0 characters

๐Ÿ’ก Quick Guide

  • โ€ข Text Mode: Encodes as you type; text is converted to UTF-8 bytes first, so accents and emoji work
  • โ€ข File Mode: Encode any file up to 50 MB, or several at once and download them all as JSON
  • โ€ข URL-safe: Creates Base64 safe for URLs and filenames (- _ instead of + /, no padding)
  • โ€ข Line Breaks: MIME-style formatting with 76 characters per line
  • โ€ข Data URI: Ready to paste into an <img src> or CSS url()

Summary: encode to Base64, free and private

To encode text or a file to Base64 for free and without uploading it, type or paste into Input Text, or open File Upload and choose a file. The Base64 appears in Base64 Output straight away, and Copy or Download .txt saves it. Everything runs in your browser; the Network tab in your browser's DevTools shows that no request is sent.

Base64 is an encoding that represents bytes with 64 printable characters (Aโ€“Z, aโ€“z, 0โ€“9, + and /), padded with =. It lets binary data, such as an image, travel through text-only systems like JSON, HTML, CSS, email and URLs. The output is about one third larger than the input and is not encrypted. To reverse the result, decode it back to text or a file; for a picture there is a dedicated image to Base64 page.

Table of Use: input, setting, output

You enterSettingBase64 Output
Hello WorldDefaultsSGVsbG8gV29ybGQ=
โœ“ ร  la mode (14 bytes as UTF-8)Defaults4pyTIMOgIGxhIG1vZGU=
<<???>>DefaultsPDw/Pz8+Pg==
<<???>>URL-safe Base64PDw_Pz8-Pg (no padding)
100 letters xInsert line breaksTwo lines: 76 characters, then the remaining 60
A file hello.txt containing Hello WorldFile UploadSGVsbG8gV29ybGQ=
The same fileFile Upload + Output as data URIdata:text/plain;base64,SGVsbG8gV29ybGQ=

The options change the text, not the data it carries:

VariantCharactersPaddingLine breaksTypical use
StandardAโ€“Z aโ€“z 0โ€“9 + /=NoneJSON fields, headers, general use
URL-safeAโ€“Z aโ€“z 0โ€“9 - _DroppedOptionalURLs, file names, JWT parts
Insert line breaksStandard=Every 76 charactersEmail (MIME) style text
Data URIStandard=Noneimg src and CSS url()

Features

  • Text mode. Encodes as you type and shows the input in characters and in UTF-8 bytes.
  • File mode. Choose files or drag them in: any type, up to 50 MB each and 100 MB per batch. A file that is too large is skipped with a message.
  • Several files at once. Click a file to show its Base64, copy one with its own button, or save all as base64-files.json.
  • URL-safe Base64. Uses - and _ and drops the = padding. It and Insert line breaks are greyed out while Output as data URI is on.
  • Insert line breaks. Wraps the output at 76 characters per line (lines end in LF).
  • Output as data URI. In file mode only: data:<type>;base64,โ€ฆ on one line, falling back to application/octet-stream when the file type is unknown.
  • Copy, Download .txt and Clear. Download saves base64-encoded.txt in text mode, or the file name plus .base64.txt in file mode.

Escape link characters with the URL encoder, markup with the HTML entity encoder, or take a file's checksum with the SHA-256 hash generator. For secrecy rather than transport, use the text encryption tool.

How to Use the Base64 Encoder

  1. Under Encoding Mode, choose Text Input to encode typed text, or File Upload to encode files.
  2. In text mode, type or paste into "Input Text". In file mode, click Choose files or drag files onto the box.
  3. Tick "URL-safe Base64" or "Insert line breaks" if needed, or "Output as data URI" in file mode.
  4. Read the result in "Base64 Output". With several files, click a file to show its Base64.
  5. Click Copy or Download .txt, or Download all (.json) for several files, and Clear to start again.

Who Can Use It

Web developers embed a small icon or font as a data URI to save a request; the data URL converter covers the full data: URL format. Back-end developers encode binary payloads for APIs and configuration files, and email administrators use the 76-character option for MIME-style lines.

Students can compare with the text to ASCII converter or binary to text converter, and the JSON formatter tidies JSON that carries Base64.

FAQs

How do I encode text to Base64?

Type or paste the text into the Input Text box and the Base64 appears in Base64 Output as you type. The text is converted to UTF-8 bytes first, so accented letters, other alphabets and emoji encode correctly: "Hello World" becomes SGVsbG8gV29ybGQ=. Click Copy or Download .txt to use the result. There is no sign-up.

How do I convert an image or file to Base64?

Click File Upload, then Choose files, or drag files onto the box. Any file type works, up to 50 MB each and 100 MB per batch. Tick "Output as data URI" to get a ready-made data:image/png;base64,โ€ฆ string for an img tag or CSS url(). With several files, each has its own Copy button.

When should I use URL-safe Base64?

Use it when the encoded string goes into a URL, query parameter, file name or JWT, where +, / and = cause problems. URL-safe Base64 (RFC 4648 section 5) uses - and _ instead of + and /; this tool also drops the = padding, as JWTs do. Leave it off for email and data URIs, which expect standard Base64.

Why is the Base64 output about 33% bigger than the input?

Base64 writes every 3 bytes as 4 characters, so the output length is 4 ร— ceil(bytes รท 3). Large inputs grow by about 33%, small ones by more because of padding: 11 bytes become 16 characters, 45% larger. Line breaks add a little more. The tool shows the increase, rounded to a whole percent, under the output.

Why does my Base64 differ from another tool for the same text?

Base64 encodes bytes, so the result depends on how the text was turned into bytes first. This tool always uses UTF-8, so รฉ becomes w6k=. Plain English text gives the same bytes in UTF-8, Latin-1 and Windows-1252, but not in UTF-16: PowerShell's [Text.Encoding]::Unicode turns Hi into SABpAA== instead of SGk=. A trailing newline, Windows CRLF line endings, or the URL-safe and line-break options also change the string.

How do I Base64 encode a username and password for HTTP Basic auth?

Type username:password into Input Text with URL-safe Base64 and Insert line breaks off, then send the result in an Authorization header after the word "Basic". The encoding happens in your browser, but Base64 gives no protection, so use HTTPS, and prefer your HTTP client's built-in Basic auth option for real credentials.

Is my text or file uploaded when I encode it?

No. Text and files are encoded by JavaScript in your browser and never leave your device; the Network tab in your browser's DevTools shows no request when you type or choose a file. Nothing is stored, so closing or reloading the page clears the input and the output.