Base64 Encode & Decode

· Free browser tool

Base64 is an encoding that represents arbitrary text or binary data using only 64 plain ASCII characters, so it can travel safely through systems that expect simple text, such as data URIs, email headers, JSON Web Tokens, basic-auth strings, and inline image sources. This tool encodes any text to Base64 and decodes Base64 back to readable text, with both directions handled in a fully UTF-8 safe way so accented characters and emoji survive the round trip intact.

It is completely free and runs entirely in your browser, with no sign-up and no server call. Paste the text or the Base64 string, switch between the Encode and Decode tabs, and the result updates as you type, with an optional data URI wrapper and a clear error flag when a string is not valid Base64.

Base64 Encode & DecodeFree · client-side
0 chars
Base64 output


    

🔒 Private: everything runs in your browser. Nothing you paste is uploaded.

How to encode and decode Base64

Pick a tab, paste your input, and read the result. The output updates on every keystroke, the character counts track both sides, and the Decode tab flags anything that is not legitimate Base64 before you copy it.

Encode text to a UTF-8 safe Base64 string

On the Encode tab the tool runs the standard browser pipeline of encodeURIComponent then btoa, which converts the text to UTF-8 bytes before encoding. That extra step matters: a naive btoa call throws on any character above the basic Latin range, so accented letters, curly quotes, and emoji would break it. Here those characters encode cleanly and decode back to exactly what you typed. The result grows by roughly a third, since Base64 spends four output characters for every three input bytes, which is the normal and expected size increase.

Decode Base64 back to text and catch malformed input

The Decode tab reverses the process with atob followed by a UTF-8 aware unescape, returning the original text rather than mojibake. Before decoding, the input is checked against the Base64 alphabet and padding rules, so a string with stray characters, a missing equals sign, or text that was never encoded at all surfaces a clear invalid-Base64 message instead of a silent wrong answer. Whitespace and line breaks are stripped automatically, and a leading data URI prefix is recognised, so wrapped or copied strings decode without manual cleanup.

Wrap output as a data URI for inline use

Tick the data URI option on the Encode tab to prefix the output with data:text/plain;base64,, producing a self-contained string a browser can render directly without a separate file or request. Data URIs are how small assets get inlined into HTML, CSS, and SVG to cut HTTP round trips, and they are also handy for embedding short snippets into config files or test fixtures. The Decode tab understands the same prefix, so a data URI pasted back in is stripped and decoded automatically, letting you move a value in either direction without editing it by hand.

Base64 encoding frequently asked questions

Q1Is Base64 encoding the same as encryption?

No. Base64 is an encoding, not encryption, and provides no security at all. Anyone can decode a Base64 string back to its original content in seconds, which is exactly what the Decode tab here does. Base64 exists to make data safe to transport through text-only channels, not to hide it. Never use it to protect passwords, tokens, or any sensitive value, because it offers zero confidentiality.

Q2Why does my Base64 string end with one or two equals signs?

The equals signs are padding. Base64 works in groups of three input bytes that map to four output characters, so when the final group is short, one or two equals signs pad it out to keep the length a clean multiple of four. A string ending in a single equals had two leftover bytes, and two equals signs means one leftover byte. The padding is part of valid Base64, so removing it can cause a decode to fail.

Q3Does this tool handle emoji and accented characters correctly?

Yes. Both directions are UTF-8 safe, so emoji, accented letters, and other non-ASCII characters encode and decode without corruption. The encoder converts text to UTF-8 bytes before applying Base64, and the decoder reverses that step, so a round trip returns precisely what you started with. A plain browser Base64 call would throw an error on these characters, which is the common cause of broken encoders elsewhere.

Q4How much larger does data get when Base64 encoded?

Roughly 33 percent larger. Base64 represents every three bytes of input as four ASCII characters, so the output is about four-thirds the size of the input, before any line breaks are added. This overhead is the trade-off for being able to send data through text-only channels. It is why large images are usually linked as files rather than inlined as Base64, where the size penalty outweighs the saved request.

Q5Is anything I paste sent to a server?

No. Every encode and decode runs locally in your browser using built-in JavaScript, and nothing you paste is uploaded, logged, or stored anywhere. The tool keeps working even with your network disconnected once the page has loaded. That makes it safe for tokens, internal strings, and any confidential text you would not want leaving your machine.

Hristo Bogdanov, Head of SEO at SEO Domains

Hristo Bogdanov

Head of SEO @ SEO Domains · CEO & Co-founder of SEO.bo

Hristo has spent 15+ years building aged-domain acquisition and screening workflows for SEO professionals, brand owners, and domain investors, and builds the free tooling SEO Domains publishes for practitioners.