Base64 encoder and decoder
Type text to encode it, or paste base64 to decode it: both sides update as you type. Standard and URL-safe alphabets, invisible characters highlighted, and JSON shown as a tree. Everything runs in your browser.
Text
0 bytes of UTF-8 text
Base64
0 characters
What is base64?
Base64 (RFC 4648) writes any bytes with 64 safe characters: A-Z, a-z, 0-9 and two more. Every 3 bytes become 4 characters, so encoded data is about a third larger than the original.
It carries binary data through channels made for text: email attachments, data: URLs, JSON fields, HTTP headers like Authorization: Basic, and the three parts of a JWT.
Standard or URL-safe?
Standard base64 ends its alphabet with + and /, and pads its output with = to a multiple of 4 characters. Those three characters need escaping in URLs, query strings and file names.
URL-safe base64, or base64url, swaps them for - and _, and usually leaves the padding out. The decoder above tells which alphabet a string uses from its characters. A string with none of the four fits both, and decodes the same way.
Tokens use base64url: paste a JWT in the JWT debugger to decode its three parts at once.
Questions
No. Encoding and decoding run in your browser, and nothing you type or paste leaves this page.
Standard base64 uses + and / for its last two characters, which have a meaning in URLs and file names. URL-safe base64 (base64url) uses - and _ instead, and usually drops the = padding. JWTs, for example, are base64url without padding.
It contains characters outside of the base64 alphabet, mixes the standard and URL-safe alphabets, has = signs before its end, or is truncated: base64 comes in groups of 4 characters, so a length of 4n + 1 is always wrong. The decoder highlights the characters at fault.
Characters that don't show on screen: control characters like NUL or escape, and invisible ones like zero width spaces, byte order marks and right-to-left overrides. They break string comparisons and can hide text, so the tool highlights each of them and names it.
The decoded bytes aren't text: base64 often carries images, compressed files or keys. The tool shows invalid bytes as �. Changing the alphabet or the padding keeps the bytes intact, but editing the text replaces them.
No. Base64 is an encoding: anyone can decode it, like this page does. Use it to carry bytes through channels made for text, never to hide data.
More free tools
License keys your app can check in one request
LicenseManager creates a key for every Stripe purchase, emails it to your customer, and validates it from your app, online or offline.