Base64 Encoder/Decoder
Encode text to Base64, decode Base64 to text, or convert files to Base64.
Base64 is a binary-to-text encoding that represents binary data as an ASCII string. It is used to embed images in HTML or CSS, send binary data over text-based protocols and encode data in URLs.
RFC 4648 defines Base64. Other standards build on it, including MIME email (RFC 2045) and data URIs (RFC 2397).
Data URIs
Embed images directly in HTML or CSS
Email attachments
Encode binary files for email transmission
Storage
Store binary or structured data in cookies or localStorage
API payloads
Transmit binary data in JSON payloads
How do I encode to Base64?
Paste your text in the Encode tab and click Encode to Base64. For a file, use the File to Base64 tab and upload it.
How do I decode Base64?
Paste your Base64 string in the Decode tab and click Decode from Base64. The tool converts it back to the original text.
What is Base64 encoding used for?
Common uses are embedding images in HTML or CSS as data URIs, sending binary data inside JSON or XML, email attachments (MIME) and HTTP Basic authentication headers.
Can I encode files to Base64?
Yes. Upload any file, such as an image, PDF or document, in the File to Base64 tab and the tool converts it to Base64. You can use the result as a data URI.
Does this support UTF-8 and special characters?
Yes. The tool encodes text as UTF-8, so emojis and characters from any language survive the round trip.
Private by default
The tool encodes and decodes in your browser and sends nothing to a server.
Related tools
JSON Formatter
Format JSON online in your browser. Paste or upload JSON to tidy it with 2 or 4 space indents, find syntax errors, minify it or browse it as a collapsible tree.
JavaScript to JSON
Convert JavaScript object literals to valid JSON
JSON Merge
Merge two JSON objects online with a deep or shallow strategy and choose how arrays combine. Useful for config files and API responses. Free, no signup.