Base64 Encoder Decoder
Base64 turns bytes into text-safe characters, but it does not hide the original data. Use this Base64 encoder decoder when you need to turn UTF-8 text into a Base64 string for transport, or inspect a Base64 value and turn it back into readable text. It is useful for checking API payloads, Basic Auth strings, small JSON blobs, data URL fragments, and copied values from logs or config files.
Quick answer
Base64 uses a limited alphabet of letters, numbers, plus, slash, and sometimes trailing equals signs for padding.
What this tells you
- •Base64 uses a limited alphabet of letters, numbers, plus, slash, and sometimes trailing equals signs for padding.
- •Encoding starts with UTF-8 text, converts that text to bytes, then maps those bytes into Base64 characters.
- •Decoding runs the process in reverse and tries to rebuild valid UTF-8 text from the Base64 input.
- •The tool reports invalid Base64 clearly instead of guessing when the input is broken or not text.
How to Use
- 1Paste plain text if you want to encode it, or paste a Base64 string if you want to decode it.
- 2Choose Encode Base64 to turn readable text into a Base64 value for transport or storage.
- 3Choose Decode Base64 to turn a Base64 value back into UTF-8 text.
- 4Review the output and the input and output lengths, then copy the result where you need it.
How It Works
Formula
Encode: UTF-8 text -> bytes -> Base64
Decode: Base64 -> bytes -> UTF-8 textBase64 works on bytes, not on abstract characters. When you encode, the browser first converts your text to UTF-8 bytes. Those bytes are then regrouped into 6-bit chunks, and each chunk is mapped to a Base64 character. When you decode, the process reverses. The Base64 characters become bytes again, and the tool then reads those bytes as UTF-8 text. That is why ordinary English text, accented characters, and emoji can work, but only if the original data was valid UTF-8 text in the first place.
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Encode plain text
This is the standard Base64 form of hello world in UTF-8.
Decode a common greeting
The Base64 value SGVsbG8h decodes to the text Hello! including the exclamation mark.
Encode an API credential fragment
Pairs like username:password are often Base64-encoded before they are placed into a Basic Authorization header.
Encode a short JSON payload
Small JSON fragments are often encoded before they are embedded in query values, tokens, or transport fields.
Common Base64 Strings
Handy examples you are likely to recognize while debugging logs, headers, or payloads.
| Original text | Base64 output | Why you might see it |
|---|---|---|
| hello world | aGVsbG8gd29ybGQ= | Basic test string |
| Hello! | SGVsbG8h | Greeting or sample payload |
| user:pass | dXNlcjpwYXNz | Basic Auth credential fragment |
| {"ok":true} | eyJvayI6dHJ1ZX0= | Short JSON blob |
| plain text | cGxhaW4gdGV4dA== | Simple transport example |
| https://example.com | aHR0cHM6Ly9leGFtcGxlLmNvbQ== | Encoded URL value |
These outputs are stable because Base64 is a deterministic encoding. The same UTF-8 text always produces the same Base64 string.
What Base64 Is Good For and What It Is Not
Base64 solves a transport problem. Some systems are built for plain text and can break when raw bytes, control characters, or mixed encodings pass through them. By converting bytes into a limited text alphabet, Base64 makes data safer to move through JSON fields, email bodies, HTML attributes, cookies, and older protocols that were designed around printable characters.
That practical benefit also explains why developers keep running into Base64 during ordinary work. You may inspect a JWT segment, a data URI, a copied attachment body, a browser storage value, or an Authorization header and see a long block of letters, numbers, plus, slash, and equals signs. This tool helps you quickly answer the first question, which is usually not What standard is this, but What does this thing actually say.
Base64 is not encryption and it is not compression. Anyone who can read the string can decode it. It also makes the payload larger, usually by about one third before line wrapping or transport overhead. Use it when text-safe transport matters. Do not use it when you need secrecy, integrity, or smaller file size.
Common mistakes
- Treating Base64 as security. If the goal is secrecy, you need encryption, not an encoding that anyone can reverse.
- Trying to decode arbitrary binary as text. A valid Base64 string can still represent image bytes, compressed data, or some other non-text payload.
- Removing padding or characters while copying. Missing equals signs, line breaks in the wrong place, or one dropped character can make decoding fail.
- Assuming every decoded byte sequence is UTF-8. Some systems still emit Latin-1, UTF-16, or raw binary, which this text-focused decoder will not present cleanly.
Embed this calculator on your site
Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.
<script src="https://calctide.com/embed.js" data-tool="base64-encoder-decoder" async></script>Preview the embed at /embed/base64-encoder-decoder/.