Encode / Decode
Convert text to Base64, hex, or URL encoding, and back again, right in your browser. Nothing is uploaded.
- Runs locally
- No upload
- Works offline
Encoder / Decoder
About this tool
This tool encodes or decodes text using three common schemes: Base64, hexadecimal, and URL percent-encoding. Everything runs locally in your browser using the Web platform's built-in APIs, so there is no server, no upload, and no account.
All modes handle full Unicode correctly. You can safely encode emoji, accented characters, and any UTF-8 text.
What are these encodings?
- Base64: represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). Common in JWT tokens, data URIs, and email attachments.
- Hex: each byte is written as two lowercase hexadecimal digits. Used in SHA hashes, color codes, memory dumps, and binary file inspection.
- URL: percent-encodes characters that are not safe in a URL query string or path. A space becomes
%20, an ampersand becomes%26, and so on.
Tips
- Base64 output is always about 33% larger than the input byte count because every 3 bytes expand to 4 characters.
- Hex output is always exactly twice the UTF-8 byte count of the input.
- If you get a decode error, check that you selected the right mode and direction. A Base64 string must have a length divisible by 4 (padding with
=). - URL encoding preserves letters, digits, and the characters
- _ . ! ~ * ' ( )unchanged.
About the Encode / Decode Tool
Encoding schemes translate raw bytes into text-safe representations. They do not encrypt data; the output can be reversed by anyone with the same tool. Their purpose is safe transport through channels that handle only text, such as URLs, JSON payloads, or email.
Base64
Base64 groups the input into 3-byte chunks and maps each chunk to four printable characters chosen from a 64-character alphabet. Because each output character carries 6 bits and each input byte is 8 bits, the output grows by roughly one third. Trailing = padding characters bring the total length to a multiple of four. You will see Base64 in JWT tokens, CSS data URIs (data:image/png;base64,...), and HTTP Basic Auth headers.
Hexadecimal
Hex encoding writes each byte as exactly two lowercase hex digits. The output is always exactly twice the number of UTF-8 bytes in the input. Hex strings appear in SHA-256 and MD5 hashes, color values in CSS, IPv6 addresses, and raw binary file inspection. This tool tolerates spaces in hex input when decoding, so you can paste formatted dumps directly.
URL Percent-Encoding
URL encoding, defined in RFC 3986, replaces any byte that is not a safe URL character with a percent sign followed by its two-digit hex code. For example, a space becomes %20 and an at-sign becomes %40. This tool uses encodeURIComponent semantics, which encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Use it to safely embed query-string values or path segments that contain special characters.
Frequently asked questions
Is my data sent anywhere?
No. All encoding and decoding runs in JavaScript inside your browser tab. Nothing is sent to a server. You can even use the tool offline after the page has loaded once.
Why does Base64 output end with = or ==?
Base64 works on groups of three bytes. When the input length is not a multiple of three, padding characters (=) fill the last group so every Base64 string has a length divisible by four.
Can I encode binary files?
This tool encodes text (JavaScript strings), not raw binary file uploads. The input is first converted to its UTF-8 byte representation. For raw file encoding you would need a file-input-based tool that reads bytes directly.
What happens if I paste invalid input when decoding?
The tool catches the error and shows a message below the output box instead of silently producing garbled text. Check that you chose the correct mode and direction.