String Encoder/Decoder

Encode and decode strings with URL, HTML, Unicode encoding

Encoding Types

URL Encoding

Converts special characters to percent-encoded format for safe URL transmission.

HTML Entities

Converts special HTML characters to their entity equivalents (<, >, &, etc.).

Base64

Encodes binary data as ASCII text using 64 printable characters.

Unicode Escape

Converts characters to Unicode escape sequences (\u0041 for 'A').

String Encoding Reference

EncodingInputEncoded outputCommon use
URL encodehello world & morehello%20world%20%26%20moreQuery strings, form data, API params
HTML entities<script>alert(1)</script>&lt;script&gt;alert(1)&lt;/script&gt;Preventing XSS in HTML output
Base64Hello, World!SGVsbG8sIFdvcmxkIQ==Binary data in text, email attachments, data URIs
Unicode escapecafé\u0063\u0061\u0066\u00e9JSON 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.

Frequently Asked Questions

Common questions about String Encoder / Decoder