Base64 Encode Decode
Base64 encode decode online: convert text or files to Base64, decode standard Base64 or Base64URL, and download the original bytes. Choose UTF-8, Latin-1 or UTF-16, create a Data URI, or convert separate lines. Files up to 20 MB are read in your browser; no account is needed.
Get Your Result in 4 Simple Steps
Add Text, a File or Base64
Choose Encode for ordinary text or a file. Choose Decode for a Base64 string, a Base64 Data URI, or a text file containing encoded data.
Choose Your Conversion Settings
Keep UTF-8 for most text. For encoding, choose URL-safe characters, keep or remove padding, and optionally wrap lines at 64 or 76 characters.
Encode or Decode
Click Encode or Decode. For example, Hello becomes SGVsbG8=; decoding SGVsbG8= returns Hello. Enable Each line separately only for independent records, not a single wrapped string.
Copy Text or Download Bytes
Copy saves the displayed output. Download saves encoded text or the decoded bytes. Binary results show a hex preview rather than broken text; Copy copies that preview.
Everything You Need in One Tool
Text and Binary File Conversion
Encode text, images, PDFs or other files without converting binary bytes into characters first. Decode Base64 back to a downloadable file.
Base64URL and Data URI Support
Decode standard or URL-safe Base64 automatically. Encoding offers the URL-safe alphabet and a separate padding control. A Base64 Data URI includes a prefix such as data:image/png;base64, before the encoded bytes.
Four Character Sets and Line Controls
Choose UTF-8, Latin-1, UTF-16 Little Endian or UTF-16 Big Endian for text. Convert independent lines separately, or wrap one encoded value at 64 or 76 characters.
Local Processing and Strict Validation
Conversion runs on your device; the widget does not upload your input to a conversion server. Invalid characters, mixed alphabets and malformed padding produce an error. Editing input or settings clears the previous result so you cannot download a stale conversion.
Who Is This Tool For?
-
Inspect API Response Values
Decode an encoded API field before checking its contents. If it contains JSON, use the JSON Formatter next. -
Prepare Image Embeds
Encode a small image with Output Data URI for a CSS or HTML embed. Image to Base64 offers a dedicated image workflow. Base64 generally adds about one third to byte size before prefixes, padding and wrapping. -
Read a JWT Payload
Copy only a JWT header or payload segment into Decode; the complete dot-separated token is not one Base64 value. Decoding shows contents but does not verify a JWT signature, expiry or permissions. -
Compare Encoded Text
Use the Hello example to check your settings, then try your own text. Different character sets, trailing newlines and padding choices can change the result even when two visible strings appear identical.
Small Changes. Big Difference.
Keep Wrapped Strings Together
Leave Each line separately off when decoding one value split across lines. Ordinary spaces and line breaks are ignored in this mode. Switch it on only when every line is a separate encoded record.
Match the Original Character Set
Use UTF-8 for Urdu, emoji and most modern application text. If decoded text looks wrong, confirm its original encoding rather than assuming that all Base64 contains readable text.
Treat Padding Errors as a Clue
Some valid unpadded input is accepted automatically. Extra padding, mixed alphabets and impossible lengths are rejected. Compare with the source before editing the string; a damaged value may be missing meaningful bytes.
Use the Right Follow-Up Tool
Choose JSON Formatter for decoded JSON, HTML Formatter for markup, or Image to Base64 for image embeds.
Frequently Asked Questions
Base64 represents bytes using printable characters so binary data can travel through text fields. Three input bytes normally become four encoded characters. For the standard alphabet and padding rules, see RFC 4648.
Paste text and click Encode, or paste Base64 and click Decode. Hello encodes to SGVsbG8=.
No. Anyone can decode it without a secret key. Base64 does not hide passwords or make a token trustworthy. Use encryption and appropriate authentication when your application needs those protections.
Yes. Paste its Base64 or Base64 Data URI, click Decode, then Download. The filename may be generic when the input does not identify its media type.
Invalid alphabet or padding causes an error. A binary preview means the bytes are not valid text in the selected character set; they may be an image or document. Download preserves those bytes.
One or two trailing = characters pad standard Base64 to a multiple of four characters. Keep = padding controls encoding. Base64URL often omits padding; follow the requirements of the receiving system.
UTF-8, Latin-1 and both UTF-16 byte orders are available. UTF-8 supports emoji and non-English text. File encoding preserves the original bytes independently of the text character-set selector.
The widget reads files locally, with a 20 MB file-input limit. Loading the website still needs internet access.
Yes, for independent text records. Enable Each line separately before conversion. Binary file encoding uses one byte stream instead. Decode a single wrapped Base64 string with the separate-line option switched off.
A complete JWT must be split into its encoded segments first. An ordinary URL is text to encode, not a remote file-fetch command. The converter does not download remote resources or verify tokens.