URL, HTML, Base64 Encoder & Decoder — Free Online Tool
Encode and decode URL parameters, HTML entities, Base64 strings, JavaScript string escapes, and Unicode escape sequences. Auto-detect encoding type, swap input/output with one click, and upload files for Base64 conversion. 100% client-side — nothing is sent to any server.
How to Use the Encoder / Decoder
- Choose an encoding tab — URL, HTML, Base64, JS String, or Unicode.
- Select encode or decode mode using the toggle buttons.
- Paste or type text in the input area — the output updates in real-time.
- Use Auto-Detect to let the tool figure out what encoding your input uses.
- Swap input and output with one click to reverse the operation.
- Upload a file in Base64 mode to encode its contents as a Base64 string.
- Copy output with the button or click the copy icon in the output header.
Encoding Types Explained
URL Encoding converts special characters into percent-encoded format (%20 for space).
Use encodeURIComponent for individual values, encodeURI for full URLs.
HTML Encoding replaces characters like <, >, & with
their entity equivalents (<, >, &) to prevent XSS and ensure
proper rendering in HTML documents.
Base64 Encoding converts binary data to ASCII text using 64 printable characters. Commonly used for embedding images in CSS, transmitting binary data over text protocols, and encoding JWT tokens.
JS String Escape wraps text in quotes and escapes special characters for use as JavaScript string literals — including control characters, quotes, backslashes, and Unicode.
Unicode Escape converts characters to \uXXXX notation, useful for embedding non-ASCII
characters in source code and JSON where raw Unicode isn't desired.
Frequently Asked Questions
Use encodeURIComponent when encoding individual parameter values — it encodes everything except A-Z, a-z, 0-9, and - _ . ! ~ * ' ( ). Use encodeURI when encoding an entire URL — it preserves scheme, host, and path separators like /, ?, #, &.
Standard atob() doesn't handle multi-byte UTF-8 characters. Enable the "UTF-8 support" checkbox to use TextEncoder / TextDecoder which correctly handles characters like emoji, CJK characters, and accented letters.
The most common named entities: & → &, < → <, > → >, " → ", ' → '. In numeric mode, all non-ASCII and special characters are converted to &#NNN; or &xHHH; format.
The tool checks for patterns: percent-encoded sequences (%XX) suggest URL encoding, HTML entities (<) suggest HTML, characters matching [A-Za-z0-9+/=] patterns suggest Base64, and \uXXXX patterns suggest Unicode escapes. It returns the most likely match with a confidence indicator.
Yes. In the Base64 tab, click "Upload File" or drag a file onto the page. The file is read entirely in your browser and converted to a Base64 string. The file never leaves your device — no upload occurs.
JS String Escape produces a complete string literal (e.g., 'Hello\\nWorld') with proper quoting and escaping of special characters. Unicode Escape only converts characters to \uXXXX notation without wrapping in quotes — useful when you need the escape sequence itself, not a full string literal.
Use Cases
URL Parameter Encoding
Encode special characters in URLs for web requests to ensure proper data transmission and avoid broken links.
API Auth Headers
Base64 encode credentials for API authentication headers to securely transmit login information in HTTP requests.
HTML Entity Encoding
Encode HTML entities for safe display in web pages to prevent XSS attacks and ensure proper rendering of special characters.
Obfuscated String Decoding
Decode obfuscated strings to understand encoded data, analyze security tokens, or reverse-engineer encoded messages.
Query Parameter Encoding
Apply percent-encoding for query parameters to ensure special characters in search terms and form data are properly transmitted.