Base64 Encoder / Decoder
Encode any text to Base64 or decode Base64 back to text. Standard and URL-safe variants. Runs entirely in your browser — no upload, no log.
Runs entirely in your browser — nothing is uploaded or logged. Open DevTools → Network to verify zero requests.
How Base64 works
Base64 takes binary data and maps it to a 64-character alphabet: A–Z, a–z, 0–9, +, and /. The algorithm reads the input in groups of 3 bytes (24 bits) and writes each group as 4 characters using 6 bits per character. When the input length is not a multiple of 3, one or two = padding characters are appended to complete the last 4-character block.
Input bytes: [72, 101, 108] → "Hel" 6-bit groups: 18, 5, 37, 44 Base64 chars: S, F, l, s → "SFls" Every 3 input bytes → 4 output characters (~33% size overhead)
URL-safe Base64 exists because the standard characters + and / carry special meaning in URLs (+ = space in query strings; / = path separator). The URL-safe variant replaces + with - and / with _, and omits the trailing = padding — making the output safe for use in URLs, filenames, and HTTP headers without percent-encoding.
This tool uses the browser's built-in btoa() and atob() functions with a UTF-8 shim (encodeURIComponent + unescape) so that Unicode characters — emoji, Indian scripts, CJK — encode and decode correctly.
Frequently asked questions
What is Base64 used for?▼
Base64 is used to encode binary data as text so it can be transmitted safely over channels that only handle text — email attachments (MIME), embedding images in HTML/CSS as data URIs, passing binary blobs in JSON payloads, and including small assets in URLs. Any time you see something like data:image/png;base64,... in source code, that's Base64.
Is Base64 encryption?▼
No — Base64 is encoding, not encryption. It is trivially reversible by anyone. Do not use Base64 to protect sensitive data. For secrets, use proper encryption (AES, RSA, etc.). Base64 only makes binary data text-safe; it provides zero confidentiality.
URL-safe Base64 vs standard Base64 — what's the difference?▼
Standard Base64 uses + and / as the 62nd and 63rd characters, and pads output to a multiple of 4 with =. Both + and / have special meaning in URLs, and = causes issues in query strings. URL-safe Base64 replaces + with -, / with _, and strips the trailing = padding — making the encoded string safe to use in URLs and filenames without percent-encoding.
Why does my encoded string look longer than the input?▼
Base64 represents every 3 bytes of input as 4 ASCII characters, adding roughly 33% size overhead. A 3-byte input becomes 4 chars; a 300-byte input becomes ~400 chars. This is the inherent cost of making binary data text-safe.
Powered by Pyrelo
The complete work dashboard for small teams
Developer tools, finance calculators, and business utilities — all in one flat-priced dashboard.
See Pyrelo Dashboard