Base64 encoder.
Type text or drop a file and read its Base64 as you type. Standard or URL-safe alphabet, copy or download the result; everything runs in your browser.
Base64 encoder.
Need the UI around it? With Pro, your AI agent builds the form, the result card and the rest of the page from a prompt.
Get ProHow it works
3 steps, no account. It runs in your browser and nothing is uploaded.
Enter text or a file
Type or paste anything, or drop a file onto the input; the Base64 updates with every keystroke.
Choose the form
Standard or URL-safe: which should I use: pick in the bar and the result is rewritten in place.
Copy, download or swap
Copy the Base64, download it as a text file, or press Swap to decode it back.
Where Base64 is used
A third larger than the bytes, and understood everywhere: the default. Where Base64 does its work.
JSON Web Tokens
A header, a payload and a signature, each base64url-encoded and joined with dots: the token every OAuth flow hands around.
Data URLs
An image written straight into HTML or CSS as `data:image/png;base64,…`, saving a request at the cost of a third more bytes.
Email attachments
MIME writes every attachment as Base64 lines of 76 characters, because the mail protocols only promise to carry 7-bit text.
HTTP Basic auth
`Authorization: Basic` carries `user:password` as Base64. Encoding, not encryption, which is why it needs TLS.
Binary in JSON
JSON has no byte type, so a protobuf blob, a public key or a thumbnail travels in a string field as Base64.
PEM files
PEM certificates and keys are DER bytes as Base64 between `-----BEGIN` and `-----END` lines.
Everywhere
`btoa` and `atob` in every browser, `Buffer.from(s, "base64")` in Node, `base64` on the command line.
Integrity and secrets
A script tag's integrity attribute is a hash in Base64; Kubernetes secrets are Base64 in YAML.
Related tools
More encoders and decoders. Every one free, in the browser.
Pricing
Build it with Pro
The tool is free. Pro adds 6,000+ blocks, premium templates and the MCP server, so your AI editor builds the product around it.
4.9/5 out of 5 · 150+ reviewsfrom 150+ founders and developers.
- Secure checkout via Stripe
- Code lives in your repo
- Keep what you've shipped if you cancel
- License terms
Questions and answers
Before you trust the result: what to know about the format, the limits, your data and the tools next to it.
Base64 writes binary data with 64 printable characters: A to Z, a to z, 0 to 9, + and /, with = as padding. It dates from the PEM mail standard of 1987, was fixed in MIME in 1993 and is specified in RFC 4648. It exists so that bytes can travel through systems built for text, such as email and JSON.
Three bytes are 24 bits, split into four groups of six bits, each written as one of the 64 characters. The output is a third larger than the input. When the input isn't a multiple of three bytes, the last group is padded with one or two = characters so the length is a multiple of four.
Email attachments (MIME), data URLs in HTML and CSS, JSON Web Tokens, HTTP Basic authentication headers, images inlined in stylesheets, binary fields in JSON and XML, and the SSH and PEM key files on every developer's machine.
Not the standard alphabet: + and / have meanings in a URL and = is reserved, so they have to be percent-encoded. The URL-safe variant from RFC 4648 §5 swaps them for - and _ and usually drops the padding; JWTs and most web APIs use it. The encoder here offers both.
It is the default for a reason: a third larger than the bytes, where hex doubles them and Base85 adds a quarter; built into every language and browser (btoa, atob, Buffer); and understood by every protocol. Pick Base32 when case can't be trusted, Base58 for things people copy by hand, Base85 only where PDF or PostScript asks for it.
No. Base64 is an encoding, not encryption: it changes how bytes are written, not who can read them, and anyone can decode it with no key. Encrypt first (AES, age, a library's sealed box) when the content needs protecting, then encode the ciphertext if it has to travel as text.
Type or paste into the input and the Base64 appears as you type: "Man" becomes TWFu. Text is encoded as UTF-8 bytes, so accents and emoji come out the same as in every language's standard library. Copy the result, download it as a text file, or press Swap to decode it back.
Drop a file onto the input or choose one with the button, and its bytes are encoded directly, not as text. Any file the browser can hold in memory works; a few hundred megabytes is fine, and the result is a third larger.
Standard Base64 uses + and / and pads with = to a multiple of four characters: the form for email, data URLs and most APIs. URL-safe Base64 (RFC 4648 §5, "base64url") uses - and _ instead and leaves the padding off, so it can sit in a URL, a file name or a JWT without escaping. The decoder reads both.
Nothing leaves your browser. The text or file is read into memory on your machine and the encoding is computed there, in plain JavaScript; the page makes no request with it. Load the page, go offline and it keeps working.
No. The Base64 encoder is free and opens without a sign-in, an account or an install.
Nothing. The Base64 encoder holds your input in the page's memory, so closing or reloading the tab clears it, and it saves nothing in this browser.
The bar has one choice: Alphabet, standard (+ and /, padded with =) or URL-safe (- and _, no padding).
Base64 output is 4 characters for every 3 bytes, so about a third longer, and the status line under the result shows the bytes in, the characters out and the percentage.
The text is encoded as UTF-8 bytes first, so accented letters, other scripts and emoji round-trip through the decoder unchanged. Each of those characters takes more than one byte, which makes the output longer than the character count suggests.
Press Swap once there is a result and the same tool becomes the Base64 decoder, with the output moved into the input. The decoder shows the original text again.
Closest to the Base64 encoder: Base64 decoder, File to Base64, Base64 to file, Base32 encoder. Each opens on its own page, free and in the browser.
The Base64 encoder is one of 32 in its group. The group's page, /tools/encoding, lists them all.
The tool is free. Its interface is built from shadcn.io's own components (Button, Input, Slider and the rest of the registry under /ui), which come in React, Vue, Svelte and Solid. Pro adds the blocks and templates for the product around it.
4.9 out of 5 from 150+ developers
Build the product around it
Every block, template and icon, installed by your AI agent in your theme. The tools stay free.
Get Pro





