IT Tool

Base64 Encoder and Decoder - URL-safe and UTF-8 Aware

Encode text to Base64 and decode it back in your browser, with URL-safe input, missing-padding recovery, and honest errors that tell binary data apart from broken input.

Instant 100% Client-Side No Login
PROCESSINGLOCAL
LIMITNONE
PRIVACYBROWSER-ONLY
TextBase64
Paste text to check it as you type.

Input (Text)

Output (Base64)

Decoding accepts standard and URL-safe Base64 (- and _), tolerates line breaks, and restores missing padding, so tokens from URLs and JWTs decode without hand-editing. Encoding and decoding use UTF-8, so emoji and non-English text round-trip correctly.

What Base64 is for, and what it is not

Base64 solves one specific problem: moving arbitrary bytes through channels that were only built for text. Email headers, JSON fields, URLs, and CSS all expect printable characters, and raw binary dropped into them can be mangled by anything along the way that assumes text. Base64 takes any bytes and rewrites them using just 64 safe characters, the letters, the digits, and two symbols, so the data arrives intact on the far side. It is defined in RFC 4648, and it is why an image can live inside a stylesheet and a certificate can be pasted into a config file.

What it is emphatically not is a way to hide anything. There is no key and no secret involved; the transformation is fixed and public, so decoding is as easy as encoding, which is exactly why this tool can do it in one click. Seeing a long Base64 string can create a false sense that the contents are protected, and that misreading is a recurring source of security incidents. If the underlying data is sensitive, it needs real encryption; Base64 changes only how the bytes are written, never who can read them.

The standard and URL-safe alphabets

The classic alphabet ends in + and /, but both mean something in a URL: a plus can be read as a space and a slash as a path separator. So a URL-safe variant swaps them for - and _, and usually drops the = padding to keep tokens tidy. JWTs use this form for every segment. Because a plain decoder chokes on it, this tool detects the URL-safe characters, converts them back, and re-adds the padding, so a token copied from a URL decodes on the first try.

Why the errors are specific

A decoder can fail for genuinely different reasons, and lumping them into one message wastes your time. The input might contain characters outside the alphabet, meaning it is not Base64 at all. Its length might be impossible for whole bytes. Or it might decode perfectly into bytes that simply are not text, because it holds an image or an encrypted blob. This tool separates these: it names an out-of-alphabet or wrong-length problem as malformed input, but when the bytes are valid and merely non-text it says the content is binary, so you know the decode worked and the data just has no readable form.

Getting Unicode right

Base64 works on bytes, but text is not bytes until you choose an encoding, and that gap is where many converters quietly corrupt data. The browser’s built-in btoaonly accepts characters in the Latin-1 range, so feeding it an emoji or an accented letter directly either throws or mangles the result. The old workaround chained the deprecated escape and unescape functions, which mostly worked but is long deprecated and fragile.

This tool takes the modern route. Encoding runs your text through TextEncoder, which produces correct UTF-8 bytes for the full range of Unicode, and only then applies Base64. Decoding reverses it, turning the bytes back with TextDecoder in a strict mode that refuses invalid UTF-8 rather than inventing characters. The upshot is that an emoji, a line of Japanese, or a name with diacritics survives a round-trip exactly as you typed it.

All of this happens in your browser’s memory. There is no network request at any point, so a token, a credential, or any private string you paste never leaves your machine. Given how easily Base64 is decoded, that local guarantee is the meaningful privacy property here, not the encoding itself.

Related tools

If the Base64 you decoded turns out to be a JWT, the JWT Decoder splits and decodes its three segments and shows the claims directly. For encoding characters in a URL rather than whole payloads, the URL Encoder / Decoder handles percent-encoding, and once you have decoded a JSON payload the JSON Formatter will beautify and validate it.

How to Use

1

Pick the direction with the swap arrow: Text to Base64, or Base64 to Text.

2

Paste your input; the status line checks it as you type.

3

Click Encode or Decode to produce the result.

4

When decoding, URL-safe characters, line breaks, and missing padding are handled for you.

5

Copy the result, or swap to send it back through in the other direction.

Features

Encodes and decodes both ways, using UTF-8 so emoji and non-English text round-trip cleanly
Decodes URL-safe Base64 (- and _) and restores dropped padding, so JWT and URL tokens just work
Tolerates line breaks in pasted Base64, as produced by MIME and PEM wrapping
Tells binary data apart from broken input instead of showing one vague error
Shows the byte sizes and the ~33% size increase encoding adds
Runs entirely in your browser; nothing you paste is uploaded or stored

Common Questions

Use this Base64 encoder and decoder to convert text to Base64 and back in your browser, with proper UTF-8 handling so emoji and non-English text round-trip cleanly. Decoding accepts URL-safe Base64 with - and _, tolerates line breaks from MIME and PEM wrapping, and restores dropped padding, so JWT and URL tokens decode without hand-editing. When the bytes are not text it says the data is binary rather than printing garbage, and it shows the roughly 33% size increase encoding adds. Nothing you paste leaves your device.

About Base64 Encoder / Decoder

Convert text to Base64 and back in your browser, using TextEncoder and TextDecoder so emoji and non-English text round-trip correctly rather than being mangled by the legacy escape/unescape trick. Decoding accepts URL-safe Base64 (- and _), tolerates line breaks from MIME and PEM wrapping, and restores dropped padding, so JWT and URL tokens decode without hand-editing. Errors are specific: out-of-alphabet or wrong-length input is named as malformed, while valid bytes that are not UTF-8 are reported as binary rather than printed as garbage. It also shows the byte sizes and the roughly 33% overhead encoding adds. Nothing you paste is uploaded.

Also known as: base64 encode, base64 decode, encode base64, decode base64, base64 to text, text to base64, base64 converter, url safe base64, base64 jwt, base64 string decoder, base64 online, atob btoa.

Processing Note

Base64 Encoder / Decoder runs in your browser, so the input you enter is processed locally on this page and is not uploaded to a ToolMintX account.

Tool Limits

IT tools provide quick diagnostics and transformations. They cannot see every private network, deployment setting, proxy, firewall, or production edge case.

Explore More