InTab

Base64 Encode & Decode

Turn text or images into Base64 and back — UTF-8, data URLs, PNG/JPEG/WebP conversion. The output updates as you type, and nothing leaves this page.

Tool input stays in your browser

Did you know · Data

A UUID is 128 bits, usually printed as 32 hex digits in five hyphen-separated groups.

Plain text

you edit

Base64

read only
Encoded Base64 appears here.

Why a dedicated encoder instead of btoa in the console

The browser's btoa only accepts Latin-1. Paste a JSON payload with an em dash or an emoji and it throws. This tool encodes UTF-8 bytes first, so the result is what servers, JWTs, and HTTP headers actually expect. Decode reverses that: Base64 to bytes, then UTF-8 text.

There is no Convert button. Switching Encode and Decode, or toggling URL-safe, recomputes the other pane immediately.

Standard vs URL-safe

Classic Base64 uses + and /, with = padding. Those characters are awkward in query strings and file names. URL-safe swaps them for - and _ and drops the padding — the alphabet JWT payloads and many APIs use. Encoding respects the toggle; decoding accepts both alphabets so a token pasted with the flag off still works.

Wrapped output and messy input

Wrap at 76 chars inserts newlines the way MIME and some PEMs expect. On decode, whitespace is stripped first, so you can paste a certificate body or a log line that was folded without cleaning it up.

Use as input swaps the result into the other mode, so you can encode, inspect, and decode again without copy-paste.

Images and data URLs

Switch to Image to go from a PNG, JPEG, GIF, WebP, SVG, BMP, or ICO file to Base64, or from a pasted data:image/…;base64,… string back to a picture. Data URL wraps the payload so you can drop it into CSS or HTML. Raw Base64 is available if you need only the alphabet.

The Output format can keep the original bytes or rasterise through a canvas to PNG, JPEG, or WebP. JPEG fills transparent pixels with white first, because JPEG has no alpha. Animated GIFs and SVGs become a still bitmap when you convert — keeping Original format preserves the source bytes.

Data URLs always use the standard Base64 alphabet. URL-safe encoding is offered only for raw payloads, because data:image/png;base64, consumers do not accept - and _.

Why it is private

Encoding and decoding run as JavaScript inside this page. Open DevTools, switch to the Network tab, and paste a token: no request carries that token. That matters because Base64 is how people move session cookies, screenshots, basic-auth headers, and JWT payloads around.

Base64 FAQ

Base64 encode, Base64 decode, URL-safe Base64, image to Base64, and data URLs — locally in this tab.

What is Base64 encode?

Base64 encode turns binary or text into an ASCII alphabet of A–Z, a–z, 0–9, +, and /. It is used in data URLs, email attachments, and some APIs. This Base64 encoder converts UTF-8 text or image files in your browser and can wrap lines at 76 characters for MIME.

How do I decode a Base64 string?

Paste the Base64 into this Base64 decoder and choose Decode. Standard and URL-safe alphabets are accepted. The result is UTF-8 text, or an image preview if the bytes are PNG, JPEG, GIF, WebP, or SVG. Decoding never sends the string to a server.

What is URL-safe Base64?

URL-safe Base64 replaces + with - and / with _ and often omits padding = so the string can sit in a query parameter. Encoding here can emit that alphabet; decoding accepts both standard and URL-safe input.

How do I convert an image to Base64 or a data URL?

Open or drop a PNG, JPEG, GIF, WebP, or SVG on this page. Encode produces Base64; enable a data URL prefix when you need to paste into CSS or HTML. Converting to PNG/JPEG/WebP rasterises through a canvas; keep original format to preserve source bytes including animated GIFs.

Why did my Base64 decode look like garbage?

Classic btoa/atob are Latin-1. This tool always goes through UTF-8 bytes, so non-ASCII text round-trips. If the input is not valid Base64, you get an error instead of mojibake. Binary that is not text should be treated as an image or downloaded as bytes.