What is Base64?
Base64 is a way of representing arbitrary binary data — or text — using only 64 safe, printable characters: the letters A–Z and a–z, the digits 0–9, and the symbols + and /, with = used as padding at the end. It exists because many systems — older email and network protocols especially — were built to carry plain text and can corrupt raw bytes. Re-encoding bytes in this restricted alphabet lets binary content travel safely through text-only channels and be reconstructed exactly at the other end.
How Base64 works
Encoding works in small groups. The input is read three bytes at a time — 24 bits in total — and those 24 bits are split into four groups of 6 bits. Each 6-bit group has a value from 0 to 63, which maps directly onto one character of the Base64 alphabet. If the final group has fewer than three bytes, the output is padded with one or two = characters so the decoder knows how many real bytes to produce. Decoding reverses the process: every four characters become three bytes again. This tool converts your text to its UTF-8 bytes before encoding, and interprets decoded bytes as UTF-8, so characters such as é, 中, or 🙂 round-trip correctly instead of breaking, as they do in naive Latin-1-only implementations.
Why Base64 output is about 33% larger
Because three input bytes become four output characters, Base64 data is always roughly one third bigger than the original — a 33% size overhead, plus a little padding. A 300 KB image becomes about 400 KB when Base64-encoded. That cost is worth paying when binary data must pass through a text channel, but it is pure overhead everywhere else — do not Base64-encode data that already travels in binary form, such as a normal file download.
Base64 is not encryption
This point matters: Base64 provides no security at all. It is an encoding, not encryption or hashing. Anyone who sees a Base64 string can decode it instantly with no key, exactly as this page does. Never use Base64 to protect passwords, tokens, or personal data, and treat Base64 values you meet in the wild — for example in HTTP Basic authentication headers, which are simply username:password encoded — as plain text. If data needs confidentiality, it needs real encryption such as TLS in transit or a modern authenticated cipher at rest.
The URL-safe variant
Two characters in the standard alphabet, + and /, have special meanings in URLs, and the = padding is often escaped as well. The URL-safe variant (RFC 4648 §5) replaces + with - and / with _, and usually drops the padding. It is used in JSON Web Tokens (JWTs), in many API tokens, and anywhere encoded data is placed in a URL, filename, or cookie. Tick the option above to produce URL-safe output; the decoder on this page accepts both alphabets automatically.
Common uses and examples
You will run into Base64 in data URIs that embed small images in HTML or CSS, in MIME email attachments, in configuration files and secrets, in API tokens, and in the three dot-separated segments of a JWT. A few reference examples: Hello encodes to SGVsbG8=, NetTools encodes to TmV0VG9vbHM=, and the check mark character ✓ — three bytes in UTF-8 — encodes to 4pyT.
How to use this tool
Paste or type your text into the input box and choose Encode or Decode. The result appears in the output box, along with character and byte counts. Swap moves the output back into the input so you can chain operations or verify a round trip, Copy puts the output on your clipboard, and Clear empties both boxes. If decoding fails, you get a specific error: either the input is not valid Base64, or it decodes to bytes that are not valid UTF-8 text — a common sign the original data was binary.
Frequently asked questions
Is my text uploaded to a server?
No. Encoding and decoding happen entirely in JavaScript on this page. You can verify this by loading the page, disconnecting from the network, and using the tool offline.
Why did decoding fail with an invalid UTF-8 error?
The Base64 was syntactically fine, but the bytes it represents are not UTF-8 text. That usually means the original data was a binary file, or text encoded in another charset such as Latin-1 or UTF-16. This tool decodes text; binary payloads need a hex or file-oriented tool instead.
Does Base64 make data safe to store or send?
No. Base64 is a transport encoding with zero confidentiality. Use it only to carry data safely through text-based systems, and layer real encryption underneath whenever the content is sensitive.
Can I encode a whole file here?
This page is designed for text; very large inputs will be slow in a browser tab. For files, use a command-line tool such as base64 on Linux and macOS or certutil -encode on Windows.
Explore more tools
- What Is My IP — see the public IP address you are connecting from.
- DNS Lookup — query A, AAAA, MX, TXT and other DNS records.
- SSL Checker — inspect a site's TLS certificate and expiry.
- Port Checker — test whether a TCP port is reachable.
- Speed Test — measure your connection's download and upload speed.
- Subnet Calculator — work out network ranges from a CIDR block.
- Timestamp Converter — convert Unix timestamps to dates and back.
- User Agent Viewer — see and parse your browser's user agent string.
- JSON Formatter — format, validate and minify JSON.
- Password Generator — create strong random passwords locally.
- All NetTools — browse the full tool directory.