Base64 encoder and decoder
Convert text to Base64 and back in your browser. Encoding uses UTF-8, so Sinhala, Tamil, emoji and every other language round-trip correctly. Switch on URL-safe mode for Base64url used in JWTs and web addresses, or encode a whole file, such as an image, into Base64 or a ready-to-paste data URL. When decoding, the tool accepts both alphabets, ignores line breaks, points to any invalid character and lets you download binary results.
Mode
How to use the Base64 Encoder & Decoder
- 1
Choose encode or decode
Pick 'Encode' to turn text or a file into Base64, or 'Decode' to turn Base64 back into text.
- 2
Paste text or choose a file
Type or paste your input. To encode a file, use 'Encode a file'.
- 3
Pick the options
Turn on URL-safe for Base64url, or 'Output as data URL' for files you want to embed in HTML or CSS.
- 4
Copy the result
The output updates as you type. Copy it, or download decoded binary data as a file.
How Base64 works
Base64 (RFC 4648) writes every 3 bytes as 4 characters from a 64-character alphabet (A–Z, a–z, 0–9, + and /), so binary data can travel through systems that only handle text. Output is about a third larger than the input; '=' pads the last group.
Base64url replaces + and / with - and _ and usually drops the padding, so the result is safe in URLs and file names. Base64 is an encoding, not encryption: anyone can decode it.
- "foobar" → Zm9vYmFy
- "f" → Zg==
- output length = 4 × ⌈bytes ÷ 3⌉
When to use it
- Embed a small image or font in CSS or HTML as a data URL.
- Read the contents of Base64 fields in API responses, emails or configuration files.
- Prepare credentials or binary values for systems that only accept text.
Limits
- Files up to 20 MB, so the page stays responsive.
- Base64 does not hide or protect data; use proper encryption for secrets.
Privacy
Encoding and decoding happen entirely in your browser. Your text and files are never uploaded.
Frequently asked questions
Is Base64 encryption?
No. Base64 only changes how data is written. Anyone can decode it, so never use it to protect passwords or private data.
Why does my decoded text look broken?
The data may be binary, such as an image or compressed file, rather than text. The tool shows a hex preview and lets you download it instead.
What is the difference between Base64 and Base64url?
Base64url uses - and _ instead of + and / and usually has no '=' padding, so it can appear in web addresses and JWTs without escaping.
Does it support Sinhala, Tamil and emoji?
Yes. Text is encoded as UTF-8, the standard used on the web, so any language round-trips exactly.
Why is the Base64 output longer than my text?
Every 3 bytes become 4 characters, so output is about 33% larger. Non-English characters take 2–4 bytes each in UTF-8.
What is a data URL?
A data URL puts a file directly into a link, such as data:image/png;base64,…, so it can be used in HTML or CSS without a separate file.
Related tools
People also use
- JWT Generator & SignerCreate and sign JSON Web Tokens with HMAC, RSA or ECDSA keys, entirely in your browser.
- CSV to JSON ConverterConvert CSV ⇄ JSON with correct quoting, types and nested data.
- UUID GeneratorBulk UUID v4 and v7 generator with a UUID inspector.
- JSON FormatterBeautify, validate, minify and sort JSON.
Last updated November 19, 2026 · How we build and test our tools