Base64 Encode Decode rfc 4648
Encode text to Base64 or decode Base64 back to UTF-8 text. Handles multi-byte characters and the URL-safe variant.
What this tool does
Base64 represents binary data using only 64 printable ASCII characters. It reads the input three bytes (24 bits) at a time, splits those bits into four six-bit groups, and maps each group to a character from A-Z, a-z, 0-9, plus and slash. When the input length is not a multiple of three, the remaining slots are filled with the = padding character. Because six bits of data are carried by an eight-bit character, encoded output is roughly 33 percent larger than the original.
The reason Base64 exists is that many transport channels only carry text safely. Email bodies, JSON string fields, HTTP headers, and XML attributes can corrupt raw binary because of control characters and encoding differences. Converting to Base64 turns any binary payload into a safe ASCII string that passes through those channels unchanged.
This tool runs in the browser and never sends your input to a server. It handles multi-byte UTF-8 characters correctly at the byte level, and it supports the URL-safe alphabet that replaces plus with hyphen and slash with underscore for use in URLs and filenames.
When to use it
Use it to inspect a Base64 field inside an API response, to read the header and payload of a JWT, to embed an image directly in HTML or CSS as a data URI, to check the credentials packed into an HTTP Basic authorization header, or to find out what an unfamiliar long string in a log actually contains. Reviewing Base64 values stored in configuration files or Kubernetes secrets is another common case.
Input and output examples
Hello, devtools
SGVsbG8sIGRldnRvb2xz
ASCII input is one byte per character, so 15 characters become 20.
Korean text νκΈ ν
μ€νΈ
7ZWc6riAIO2FjOyKpO2KuA== (for the Korean part)
Each Korean character takes three bytes in UTF-8, so output grows faster and padding appears.
c3ViamVjdD9kYXRhPjE=
subject?data>1
Decoding direction. Include the padding to restore the original exactly.
Notes and limitations
Base64 is not encryption. Anyone can reverse it instantly, so encoding a password or API key provides no protection at all. If decoding fails, the usual causes are stripped = padding, a mixed URL-safe alphabet, or embedded line breaks. Also remember that decoded output is not always readable text: if the original payload was an image or an archive, seeing broken characters is the expected result.
Frequently asked questions
Does Base64 make data secure?
No. It is an encoding, not encryption, and any tool can reverse it immediately. Use real encryption such as AES if the data must be protected.
What is the = sign at the end?
Padding. Base64 works on three-byte groups, so when the input length is not a multiple of three the remaining slots are filled with =. One leftover byte produces ==, two leftover bytes produce a single =.
When should I use URL-safe Base64?
The standard alphabet contains plus and slash, which have their own meaning inside URLs and filenames. The URL-safe variant replaces them with hyphen and underscore. JWT is the most common example.