Convert text to Base64 or decode Base64 back to UTF-8 text instantly in your browser, with validation and lengths shown — free, private, and runs entirely in your browser.
Base64 Encode/Decode
Encode text to Base64 or decode it back — UTF-8 safe, validated, and done entirely in your browser.
Enter your values
Fill in the fields below — the result appears with every step shown.
Your result will appear here
Enter your values above, then press Calculate — or press Enter in any field.TinyExe · Base64 Encode/Decode Result
Calculated locally in your browser
—
Name
—
Text or Base64 input
—
Operation
—
Result
—
How this was calculated
What to do next
TinyExe PDF & PNG exports carry the TinyExe logo and tinyexe.com header & footer.
Runs 100% in your browser — your numbers never leave this tab; nothing is uploaded or stored.
The short answer
Base64 encoding converts every three bytes of data into four characters from a 64-character alphabet, adding about 33 percent length plus equals-sign padding. For example, the text Hello encodes to SGVsbG8=, which is eight characters. Decoding reverses the process exactly, because Base64 is an encoding, not encryption.
- Hello → SGVsbG8=
- Output length = 4 x ceil(bytes/3)
- Base64 is reversible by anyone — it is not encryption
Base64 size overhead
Reference values for this calculator.
| Input bytes | Base64 characters | Overhead |
|---|---|---|
| 3 | 4 | 33% |
| 30 | 40 | 33% |
| 300 | 400 | 33% |
| 10 bytes (not multiple of 3) | 16 (with padding) | 60% on the last partial group |
The formula
The exact formula this calculator uses — every variable in it is explained in the card below.
The formula
Base64 exists to carry binary data through text-only channels (email, URLs, JSON). It is an encoding, not encryption — anyone can decode it. This implementation is UTF-8 safe: text is first encoded as UTF-8 bytes, so accented and non-Latin characters round-trip correctly, and the decoder validates the alphabet and padding before decoding instead of silently producing garbage.
Worked examples
Worked examples with the full working shown — try them in the calculator to check.
Example 1
Encoding "Hello"
Text: Hello, mode: Encode
| Calculation | Steps |
|---|---|
| Hello is 5 UTF-8 bytes: Hel (3 bytes) becomes SGVs, lo (2 bytes) becomes bG8 and one = pad is added. | SGVsbG8= — 8 characters out for 5 characters in. |
Result
Example 2
Decoding back
Text: SGVsbG8=, mode: Decode
| Calculation | Steps |
|---|---|
| The string is valid Base64 (length 8, one pad). Reversing the alphabet mapping byte by byte returns the original UTF-8 bytes. | Hello — 5 characters, an exact round trip. |
Result
Example 3
A longer word
Text: TinyEngine, mode: Encode
| Calculation | Steps |
|---|---|
| 10 bytes = three full groups of 3 plus 1 leftover byte: 4 x ceil(10/3) = 16 characters including == padding. | VGlueUVuZ2luZQ== — 16 characters. |
Result
How to use this calculator
Step 1
Paste or type the text you want to encode, or the Base64 string you want to decode.
Step 2
Choose Encode or Decode.
Step 3
Press Calculate to see the full output and its length.
Step 4
Copy the output from the detail card.
Frequently asked questions
Is Base64 encryption?
No. Base64 is a reversible encoding with no key — anyone can decode it instantly. Never use it to hide passwords or secrets; use real encryption for that.
Why is Base64 output longer than the input?
Every 3 bytes become 4 characters, a fixed 33% overhead, plus up to two = padding characters when the input length is not a multiple of 3.
What does the = at the end mean?
Padding. Base64 output length must be a multiple of 4; one or two = signs fill the final group when the input ends with 1 or 2 leftover bytes.
Why did my decoded text come out garbled elsewhere?
Usually because the other tool treated the bytes as Latin-1 instead of UTF-8. This tool encodes text to UTF-8 bytes first, so characters like é or 你好 round-trip correctly.
What is the difference between Base64 and base 10 or base 64 numbers?
Different things: search terms like "base 64 to base 10" mix them up. Base64 here is the RFC 4648 text encoding; converting numbers between bases is a numeral-system conversion, not what this tool does.
About this calculator
The Base64 Encode/Decode tool converts text into Base64 — the encoding used to embed binary data in email, JSON, data URIs and web tokens — and converts Base64 strings back into readable text. It validates input, handles UTF-8 properly, and reports the input and output lengths.
Computers store bytes (values 0-255), but many channels only safely carry printable text. Base64 solves this by regrouping the byte stream into 6-bit chunks — 64 possible values — and printing each chunk as one safe character: A-Z, a-z, 0-9, plus + and /. Three bytes (24 bits) become exactly four 6-bit characters, which is why output grows by a third.
When the input does not divide by 3, the final partial group is padded with = signs so the output length is always a multiple of 4 and decoders know where the data ends. One leftover byte produces two characters plus ==; two leftover bytes produce three characters plus =.
A key honesty point: Base64 provides zero secrecy. It is an encoding like Morse code — a standard, keyless, instantly reversible representation. Obfuscated is not encrypted, and security designs that treat Base64 as protection are a well-known vulnerability pattern.
Use it when debugging API payloads and JWT fragments, embedding small assets as data URIs, checking encoded values in config files or emails, and learning how binary-to-text encoding works.
How to calculate it yourself
Step 1
Take the input bytes three at a time (24 bits).
Step 2
Split the 24 bits into four 6-bit groups.
Step 3
Map each 6-bit value (0-63) to the Base64 alphabet: 0-25 = A-Z, 26-51 = a-z, 52-61 = 0-9, 62 = +, 63 = /.
Step 4
If the last group has only 1 or 2 bytes, pad the output with == or = to a multiple of 4 characters.
Step 5
To decode, reverse the mapping and drop the padding.
Real-life examples
Debugging an API token fragment
A developer receives a token segment "eyJhbGciOi" in a log and wants to confirm it is a JSON header before escalating a bug.
Decoding eyJhbGciOiJIUzI1NiJ9 gives {"alg":"HS256"} — 13 visible characters of JSON from 20 Base64 characters (with padding rules applied).
The fragment is confirmed as a standard JWT header, so the bug hunt moves to the signature segment instead.
Embedding a tiny icon in CSS
A front-end developer inlines a 300-byte SVG icon as a data URI so it loads without an extra HTTP request.
300 bytes encode to 4 x (300/3) = 400 Base64 characters exactly, since 300 divides by 3 with no padding needed.
The CSS gains 400 characters of Base64 and saves one network round trip.
Ideas & use cases
- Round-trip test your own data: encode a string here, then decode it — any tool in your pipeline that mangles UTF-8 will show up as a mismatch.
- Estimate payload growth before choosing Base64: multiply your binary size by 4/3 to see the wire cost, which matters for email attachment limits.
- Decode suspicious config values to see what a system is really storing — remembering that anything Base64-only is effectively plaintext.
Limitations & sources
- Text/UTF-8 only: it does not encode uploaded files or images, and output is shown truncated in the detail card past 120 characters (the length figure stays exact). URL-safe Base64 (- and _ alphabet) is not offered.
Sources: RFC 4648, The Base16, Base32, and Base64 Data Encodings (IETF, 2006) — alphabet, padding and length rules
