Free URL Encoder & Decoder | OneStepToRank

URL Encoder & Decoder

Encode special characters for safe use in URLs and query strings, or decode percent-encoded strings back to readable text. Runs entirely in your browser.

Encode / Decode URLs

Common URL-Encoded Characters

CharacterEncodedDescription
(space)%20Space character
!%21Exclamation mark
#%23Hash / fragment
$%24Dollar sign
&%26Ampersand
'%27Apostrophe
+%2BPlus sign
/%2FForward slash
=%3DEquals sign
?%3FQuestion mark
@%40At sign

Dominate Local Search

Developer tools are just the start. OneStepToRank monitors your Google rankings 24/7 across your entire service area and automatically adapts your strategy to keep you on top.

Get Started Free

What Is URL Encoding?

URL encoding, formally known as percent-encoding, is the process of converting characters that are not allowed or have special meaning in a URL into a safe representation using a percent sign followed by two hexadecimal digits. This mechanism is defined by RFC 3986 (Uniform Resource Identifier) and ensures that URLs are transmitted correctly across the internet. For example, a space character is encoded as %20, an ampersand becomes %26, and a question mark becomes %3F. Without URL encoding, browsers and servers would misinterpret these characters as structural URL components rather than literal data.

RFC 3986 and Reserved Characters

RFC 3986 defines two categories of characters in URLs. Unreserved characters -- letters (A-Z, a-z), digits (0-9), hyphen, underscore, period, and tilde -- can appear in a URL without encoding. Reserved characters such as : / ? # [ ] @ ! $ & ' ( ) * + , ; = have special structural meaning in URI syntax. When these reserved characters need to appear as literal data within a URL component (such as a query parameter value), they must be percent-encoded. The encoding process converts each byte of the character's UTF-8 representation into a %HH format, where HH is the hexadecimal value of the byte. Multi-byte UTF-8 characters like accented letters or emoji produce multiple percent-encoded triplets.

URL Encoding in Web Development

Every major programming language provides built-in functions for URL encoding. In JavaScript, encodeURIComponent() encodes a string for use as a URI component, while encodeURI() encodes a full URI while preserving structural characters. Python offers urllib.parse.quote() and urllib.parse.urlencode(). PHP has urlencode() and rawurlencode(). Understanding when and how to apply URL encoding is critical for building secure web applications -- improper encoding is a common source of bugs and can lead to injection vulnerabilities when user input is placed directly into URLs without sanitization.

Frequently Asked Questions

What is URL encoding?
URL encoding (percent-encoding) converts characters that are not allowed in a URL into a safe format using a percent sign (%) followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26. This is defined by RFC 3986 and ensures URLs transmit correctly across the internet.
When should I URL-encode a string?
Encode any string that will be used as a value in a URL query parameter, especially if it contains spaces, ampersands, equals signs, question marks, or non-ASCII characters. Common scenarios include building API request URLs, constructing redirect URLs, passing form data in GET requests, and embedding URLs within other URLs.
What is the difference between encodeURI and encodeURIComponent?
encodeURI() preserves characters that have special meaning in URLs like colons, slashes, question marks, and ampersands. encodeURIComponent() encodes everything except letters, digits, hyphens, underscores, periods, and tildes. Use encodeURIComponent() for query parameter values. Use encodeURI() only when encoding a complete URL while preserving its structure. This tool uses encodeURIComponent().
What characters are safe in a URL without encoding?
Per RFC 3986, the unreserved characters that never need encoding are: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), and tilde (~). All other characters -- including spaces, ampersands, equals signs, slashes, and any non-ASCII characters -- should be percent-encoded when used in URL components like query parameter values.