📋 In This Guide
What URL Encoding Is and Why It Exists
URLs can only safely contain a limited set of ASCII characters. Anything else — spaces, punctuation with special meaning, or non-Latin scripts — needs to be converted into a safe format called percent-encoding: a % sign followed by two hexadecimal digits representing the character's byte value. A space becomes %20, an ampersand becomes %26, and so on.
Without this, a URL containing a literal space or an unescaped & inside a value could break entirely, get truncated, or be misinterpreted by the server as a separate parameter.
Query Parameters
Encode values before appending them to a URL
Form Submissions
Browsers encode form data automatically before sending
International Text
Non-Latin scripts must be encoded to travel safely in a URL
API Requests
Ensures special characters in requests aren't misinterpreted
Component vs Full URI Encoding
JavaScript (and most languages) offer two related but distinct encoding functions, matched by this tool's two modes:
: / ? & = characters survive intact.How Non-English Characters Get Encoded
Characters outside basic ASCII — Hindi, Arabic, Chinese, emoji — are first converted to their UTF-8 byte sequence, and every individual byte is then percent-encoded. This is why a single Devanagari character often expands into two or three %XX sequences once encoded, rather than just one.
Need to encode binary data instead?
Encode or decode Base64 text and data instantly.
Why + Sometimes Means Space Too
You'll sometimes see a + symbol representing a space instead of %20 — this is a legacy convention specific to the application/x-www-form-urlencoded format used by HTML form submissions and query strings, not a general URL rule. Outside that specific context, %20 is the universally correct choice, and this tool always uses %20 for consistency and correctness.
5 Common Encoding Mistakes to Avoid
Frequently Asked Questions
URL encoding (percent-encoding) converts characters not allowed in a URL — like spaces, &, or non-Latin characters — into a % followed by two hex digits representing that character's byte value, such as %20 for a space.
encodeURIComponent encodes every special character including & = ? /, safe for a single value. encodeURI preserves URL structure characters and only encodes things like spaces, appropriate for a complete URL.
%20 is the standard percent-encoding for space. + is an older convention specific to URL query strings from HTML form submissions — %20 is the universally correct choice outside that context.
Non-ASCII characters are first converted to UTF-8 bytes, then each byte is percent-encoded — a single Devanagari character often becomes multiple %XX sequences.
Decoding fails when the percent-sequence doesn't form valid UTF-8 bytes — usually an incomplete %XX sequence or a stray % not followed by two valid hex digits, meaning the input wasn't properly encoded.
Use component encoding for a single value going into a URL, like a query parameter. Use full URI encoding for an entire URL where you want to preserve its structural characters.
No. All encoding and decoding happens instantly inside your browser using native JavaScript functions. Nothing you type is uploaded, logged, or stored on any server.