Free Online Base64 Encoder & Decoder
Encode and decode Base64 strings and files. Supports UTF-8 text and binary files up to 10MB.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string. It uses 64 characters (A-Z, a-z, 0-9, +, /) to encode data, making it safe for transmission through text-based protocols like email and HTTP.
Base64 encoding increases data size by approximately 33%, but ensures that binary data can be safely embedded in text formats without corruption or misinterpretation.
How Base64 Works
Base64 encodes every three bytes of input into four ASCII characters. Each character represents 6 bits of data (2^6 = 64 possible values). If the input length is not divisible by three, padding characters (=) are added to the end.
Common Use Cases
Base64 encoding is widely used for: data URIs in HTML/CSS to embed images inline, email attachments (MIME encoding), API payloads when sending binary data in JSON, basic HTTP authentication headers, and storing binary data in text-based databases or configuration files.
Base64 vs URL Encoding
Base64 converts binary data to ASCII text, while URL encoding (percent encoding) makes text safe for use in URLs by replacing unsafe characters with %XX sequences. They serve different purposes: Base64 for binary-to-text conversion, URL encoding for URL-safe text.
Need Base64 Encoding in API Testing?
Download RestForge for full API testing with built-in encoding, pre-request scripts, and environment variables.