Base64 Encode & Decode
Convert text to Base64 and back. Handles Unicode characters and the URL-safe variant used in tokens and data URLs.
Runs in your browser. Your files are never uploaded.
Loading Base64 Encode & Decode…
How to use Base64 Encode & Decode
- Choose Encode or Decode.
- Paste your text or Base64 string.
- Copy the output, or use “Use result as input” to reverse it.
What Base64 is used for
Many protocols only handle plain text safely. Base64 converts any data into letters and digits so it can be embedded in JSON, HTML, CSS, email attachments or URLs. The cost is size: Base64 output is about 33% larger than the original.
Common places you will see it
- Data URLs: small images embedded directly in CSS or HTML (data:image/png;base64,…).
- HTTP Basic authentication headers, which carry “username:password” in Base64.
- JWT tokens, whose header and payload are URL-safe Base64 JSON.
- Email attachments (MIME) and API fields that carry file contents.
Standard vs URL-safe
Standard Base64 uses + and /, which have special meaning in URLs. The URL-safe variant swaps them for - and _ and usually drops the = padding. Use it for anything that goes in a query string, file name or JWT. This tool decodes both forms automatically.
Size, speed and limits
Base64 turns every three bytes into four characters, so output is roughly one third larger than the input. That overhead is why embedding large images as Base64 in a web page is rarely a good idea: the browser cannot cache them separately and the HTML grows. For small icons under a few kilobytes it can save a network request, which is the one case where it pays off.
This tool handles text of any reasonable size. If you need to encode a whole file such as an image, use our Image to Base64 tool, which reads the file bytes directly instead of treating them as text.
Why use this base64 encode & decode tool
- UTF-8 safe. Emoji and non-English characters encode and decode correctly.
- URL-safe option. Replaces + and / with - and _ and strips padding.
- Clear errors. Tells you when a string is not valid Base64.
Frequently asked questions
What is Base64?
Base64 is a way of representing binary data using 64 printable characters (A–Z, a–z, 0–9, + and /). It lets binary data travel safely through systems built for text, such as email and JSON.
Is Base64 encryption?
No. Anyone can decode it instantly. Never use Base64 to hide passwords or secrets.
Why does my Base64 end with = signs?
The = characters are padding that makes the length a multiple of four. URL-safe Base64 often omits them.
More free tools
PX to REM Converter
Convert pixels to rem and em, and back, with a custom root font size. Includes a table of common sizes from 8px to 64px and a copy-ready CSS declaration.
Open toolURL Encode & Decode
Encode or decode URLs and query strings with percent-encoding. Choose component or full-URL mode. Free, instant and private.
Open toolUUID Generator
Generate random version 4 UUIDs (GUIDs) in bulk. Copy one or hundreds, in uppercase or without hyphens. Uses your browser’s secure random generator.
Open tool