Encode and decode strings with URL, HTML, Unicode encoding
Converts special characters to percent-encoded format for safe URL transmission.
Converts special HTML characters to their entity equivalents (<, >, &, etc.).
Encodes binary data as ASCII text using 64 printable characters.
Converts characters to Unicode escape sequences (\u0041 for 'A').
| Encoding | Input | Encoded output | Common use |
|---|---|---|---|
| URL encode | hello world & more | hello%20world%20%26%20more | Query strings, form data, API params |
| HTML entities | <script>alert(1)</script> | <script>alert(1)</script> | Preventing XSS in HTML output |
| Base64 | Hello, World! | SGVsbG8sIFdvcmxkIQ== | Binary data in text, email attachments, data URIs |
| Unicode escape | café | \u0063\u0061\u0066\u00e9 | JSON strings, JavaScript source, i18n |
URL encoding (percent-encoding) is required in URLs because only certain characters are allowed in URIs — others must be replaced with a % followed by their two-digit hex code. HTML entity encoding prevents cross-site scripting (XSS) by converting characters that have meaning in HTML into safe equivalents that display correctly but cannot be interpreted as code. Base64 is not a compression or security mechanism — it is purely a way to represent arbitrary binary data using printable ASCII characters, which is necessary for transmitting binary content over text-based protocols like email (MIME) or embedding images as data URIs in CSS.
Common questions about String Encoder / Decoder