Base64 Encode & Decode
Encode text or files to Base64 and decode Base64 back to readable text, with Unicode and URL-safe support.
How to use the Base64
- Choose Encode or Decode.
- Type or paste your text or Base64 string.
- Turn on URL-safe output if the result goes into a URL or token.
- Copy the result, or open the file section to encode an image or PDF.
What Base64 is
Base64 represents binary data using 64 printable characters (A–Z, a–z, 0–9, + and /). It lets you put images, files or arbitrary bytes into places that only accept text, such as JSON, HTML, CSS, email and HTTP headers. Encoding makes data about 33% larger, and it is not encryption: anyone can decode it.
Unicode text
The browser's built-in btoa() fails on characters outside Latin-1, such as emoji, Hindi or accented letters. This tool first converts text to UTF-8 bytes, so any language encodes and decodes correctly, and the result matches what servers and command-line tools produce.
URL-safe Base64
Standard Base64 uses + and /, which have special meanings in URLs, and = padding. The URL-safe variant (used by JWTs and many APIs) replaces them with - and _ and drops the padding. The decoder accepts both forms automatically.
Files and data URLs
Open the file section to turn an image, font or PDF into a data URL such as data:image/png;base64,…, which you can embed directly in HTML or CSS. Keep embedded files small, because Base64 makes pages heavier and prevents separate caching. For a quick checksum of the same file, use the hash generator, and to tidy JSON that contains Base64 fields, use the JSON formatter.
Where you will meet Base64
Base64 appears in many everyday developer tasks. Email attachments are Base64-encoded inside the message. JSON Web Tokens (JWTs) are three URL-safe Base64 segments separated by dots; decoding the middle segment shows the token's claims, although you should never trust a token without verifying its signature. HTTP Basic authentication sends the username and password as Base64, which is why it must only be used over HTTPS. Many APIs also return images or PDFs as Base64 strings inside JSON responses, which you can paste here to inspect.
Frequently asked questions
Is Base64 encryption?
Why does my text decode as gibberish?
What is URL-safe Base64?
Does it support emoji and non-English text?
Related tools
- JSON Formatter & ValidatorFormat, validate and minify JSON instantly. Choose 2 or 4 spaces or tabs, sort keys and see the exact line of any error. Private, runs in your browser.
- URL Encode & DecodePercent-encode text for URLs and query strings, or decode %20-style URLs back to readable text. Shows query parameters in a table. Free and private.
- Password GeneratorGenerate strong random passwords with your choice of length, letters, numbers and symbols. Shows strength in bits. Made in your browser, never stored.
- UUID GeneratorGenerate random version 4 UUIDs (GUIDs) instantly, one or up to 1,000 at a time, in lowercase or uppercase, with or without hyphens. Free.
- Hash Generator (MD5, SHA-256)Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files, and verify a download against its checksum. Free, private, no upload.
- Color Converter (HEX, RGB, HSL)Convert colours between HEX, RGB and HSL, pick from a colour picker and check text contrast against white and black. Copy CSS values in one click.