Encoding tool

Base64 Encoder / Decoder

A Base64 encoder that also decodes Base64 encoding. UTF-8 text in, standard or URL-safe Base64 out, plus a Next.js Buffer helper. It all stays on your device.

Like the tool? Find a bug?Share with us

Encoder / Decoder

Alphabet

Paste text to encode, or Base64 to decode. UTF-8 stays intact. Files stay on this device.

Supported files: .txt, .json, .html, .htm, .md, .csv, .b64
0 / 50,000
Base64 will appear here.
A Buffer helper will appear here.

Guide

How this Base64 encoder works

01

Text becomes Base64

Encode reads UTF-8 bytes, then writes standard Base64 or the URL-safe alphabet (- and _, no padding). Data URI wraps the payload as data:text/plain;charset=utf-8;base64,.

02

Base64 becomes text

Decode accepts standard Base64, URL-safe Base64, whitespace, and data URIs. Invalid strings show an error instead of garbage. The 50,000 character cap still applies.

03

Next.js uses Buffer

The Next.js snippet uses Buffer.from for Node server runtimes. Paste it into a Server Component or route handler. Edge runtimes should keep the Web btoa / atob path this tab already uses.

Use it

What encodes well

UTF-8 text, JSON, HTML, and tokens. Unicode is encoded as UTF-8 before Base64, so café and checkmarks round-trip. Binary files are not read as bytes here — upload is UTF-8 text only. For SVG icons use the SVG to Base64 tool.

FAQ

Questions

Does this upload my text?

No. Encoding, decoding, and copy run in the browser. There is no account and no API call.

Standard or URL-safe?

Standard Base64 uses +, /, and = padding. URL-safe swaps those for - and _ and drops padding, which is what JWTs and query strings expect.

Why not btoa on the string directly?

btoa throws on characters above 255. This encoder UTF-8 encodes first, so multilingual text works. Next.js server code can call Buffer.from(value, "utf8") instead.

Is there a size limit?

Paste is capped at 50,000 characters so a huge dump cannot freeze the tab.