URL Encoder/Decoder
Encode and decode URL
Invalid URL
What URL encoding and decoding are
URL encoding, also called percent-encoding, is the mechanism that converts characters a URL cannot carry — non-Latin text and symbols — into an ASCII string in the form %XX. A URL was designed on the assumption of ASCII characters alone, so this conversion is required whenever you pass multi-byte characters or reserved characters such as ? and & as a parameter value.
This tool encodes and decodes the URL or string you enter with a single click, and the result can be copied and used as it stands. It comes into play across all sorts of development work: assembling API requests, generating redirect URLs, and inspecting the contents of an already-encoded URL handed over by another system.
How to use it
- Enter the string to convert Paste text containing non-Latin characters, or an already-encoded URL, into the input field.
- Choose encode or decode Choose encode to turn an ordinary string into percent notation, or decode to restore percent notation to the original.
- Check the result The converted string appears immediately.
- Copy the result and use it You can paste it straight into the query parameter of an API request or into a redirect URL.
Tips for getting more out of it
- The Japanese character「あ」encodes to
%E3%81%82in UTF-8 percent-encoding. - A space may become
%20in URL paths or+in query parameters — this reflects the difference between RFC 3986 and the HTML form encoding spec. - Reserved characters such as
?,&, and=must be encoded when used as parameter values. - Useful when including non-ASCII characters in REST API query parameters or when safely passing redirect URLs.
When it is useful
Building query parameters for a REST API
Use it when you want to include keywords or free-text values safely in an API query string.
Assembling a redirect URL
When embedding a destination URL as a parameter inside another URL, encoding prevents a clash with the delimiters.
Inspecting a URL received from another system
Decode a URL full of percent notation handed over by a log or an external service and you can read the actual parameter values.
Making links for email bodies and social sharing
You can safely build text into a mailto link carrying a subject and body, or into a URL for sharing on social media.
Terms used here
- Percent-encoding
- A scheme that converts a character into its UTF-8 byte sequence and expresses each byte as a percent sign followed by two hexadecimal digits. It represents characters a URL cannot carry safely.
- Reserved characters
- Symbols such as ?, &, =, # and + that are used to delimit the structure of a URL. They have to be encoded when included in a parameter value.
- Unreserved characters
- The alphanumerics plus the four symbols -, _, . and ~. RFC 3986 lays down that they need no encoding.
- RFC 3986
- The internet standard that lays down the syntax of a URI. The rules of percent-encoding are defined there as well.
- application/x-www-form-urlencoded
- The encoding format used when an HTML form is submitted. It differs from the URI standard in converting a space to a plus sign rather than to %20.
FAQ
%XX hex format safe for use in URLs. Decoding reverses that process back to the original readable text.%20 in URL path segments (per RFC 3986). Use + only in application/x-www-form-urlencoded query strings (HTML form data). When in doubt, %20 is the safer choice.- _ . ~ — can appear in URLs without encoding. All other characters, including spaces and reserved characters like & and =, must be percent-encoded when used as parameter values.
Side Note — The Birth of the URL: Tim Berners-Lee and the Dawn of the World Wide Web
The URL was designed in 1991 by Tim Berners-Lee, the inventor of the World Wide Web. It was originally conceived for ASCII characters only, which is why multibyte characters (such as Japanese) and special characters must be represented using percent-encoding.
The URL of the very first web page on the internet, http://info.cern.ch/hypertext/WWW/TheProject.html, is still accessible today. Emoji domains (e.g., 🍕.ws) are technically possible and are internally converted to Punycode (the xn-- format). While URLs can theoretically exceed 2,000 characters, practical limits imposed by browsers and servers are around 2,048 characters.
RFC 3986 defines the URL specification, but the distinction between %20 (space) and + (space) remains a frequent source of confusion. %20 is the URI standard; + is used in the HTML form application/x-www-form-urlencoded format — the choice depends on the context.