URL Encoder / Decoder
Encode text for a link, or decode a link full of % codes. Choose what you are encoding, then click Encode or Decode. Everything runs in your browser: what you paste is not sent to our server.
Result
Show each character
How each character of the readable text is stored: its UTF-8 bytes and how it looks in the selected mode. Letters outside English take 2 to 4 bytes, so they become 2 to 4 % codes.
| Character | UTF-8 bytes | Encoded |
|---|
About URL Encoder / Decoder
URL encoder and decoder: percent-encode and decode web addresses online
URL encoding, also called percent-encoding, replaces characters that are not allowed in a web address with a percent sign and two hexadecimal digits, so a space becomes %20 (or + in a form) and é becomes %C3%A9. URL decoding does the reverse and turns those codes back into readable text. Paste a link or any text into this free URL encoder and decoder, choose whether it is a single value, a full URL or form data, and click Encode or Decode. It runs in your browser, so the result appears at once and your text never leaves your device.
Web addresses were designed for a small set of ASCII characters. Letters from other alphabets, spaces, and symbols such as &, # or ? either break a link or change its meaning when they appear in the wrong place. Encoding solves that. You meet it every day: in long links full of % signs copied from a browser, in tracking links with UTM parameters, in API requests and in redirect rules. This guide explains how to use the tool, which characters need encoding and why, how text in Arabic, Hindi or Russian ends up in a URL, the difference between encodeURIComponent and encodeURI in JavaScript, and the mistakes that most often lead to broken links.
How to encode or decode a URL
- Paste your text. Put a full link, a single query value or any text into the "Text or URL" box. Under the box you see how many characters it has and how many UTF-8 bytes they take.
- Choose what you are encoding. Component (
encodeURIComponent, the default) is for one query value or path segment and encodes every separator. Full URL (encodeURI) is for a complete address and keeps: / ? # & =. Form data writes spaces as+, the way an HTML form does. - Click Encode or Decode. The result appears right away. Everything happens in your browser, so nothing you paste is sent to our server. If you then change the text or the mode, the result updates by itself.
- Copy the result with the Copy button, or click "Use as input" to move it into the box above, for example to decode a link that was encoded twice.
- Open "Show each character" to see how each letter is stored: its Unicode code point, its UTF-8 bytes in hexadecimal and how it looks once encoded.
The first screenshot shows Full URL mode with the address https://example.com/menu/café?q=green tea & honey. The result is https://example.com/menu/caf%C3%A9?q=green%20tea%20&%20honey: the scheme, the slashes, the question mark and the equals sign stay as they are, each space becomes %20, and é becomes its two UTF-8 bytes %C3%A9. The link still opens. But look at the &. Full URL mode leaves it alone, so a server reads q=green tea plus a second parameter called honey. The tool cannot know that this & belongs to the search words. To protect it, encode the value green tea & honey on its own in Component mode, which gives green%20tea%20%26%20honey, and put that after q=. If you paste a whole address in Component mode, the tool tells you that https:// will be encoded too and suggests Full URL.
The second screenshot decodes caf%C3%A9+%26+th%C3%A9 in Form data mode. The result is café & thé: each + became a space and %26 became a real &. In Component or Full URL mode the plus signs would stay, because only form data uses + for a space; the tool reminds you of that when your text contains a +. The table under "Show each character" lists every character with its code point, its UTF-8 bytes and its encoded form: é is U+00E9, stored as the two bytes C3 A9 and written %C3%A9. That is also why the counter shows 10 characters but 12 UTF-8 bytes for the decoded text.
When decoding fails, the tool explains why instead of showing a bare error. A % sign that is not followed by two hexadecimal digits, as in 50%OFF, is reported with its position. So are % codes that do not form valid UTF-8, which usually means the link was cut off in the middle of a character or was encoded with an old character set. And if a decoded result still contains % codes, the tool points out that the text was probably encoded twice.
What percent-encoding is
The rules for URLs are written in RFC 3986, the internet standard for URIs, also known as STD 66. It allows only a limited set of ASCII characters in an address. Any other byte is written as % followed by its value in two hexadecimal digits. A space is byte 32, which is 20 in hexadecimal, so it becomes %20. The standard recommends uppercase hex digits (%2F rather than %2f), although both mean the same thing.
Unreserved characters: always safe
RFC 3986 defines a small group of unreserved characters that never need encoding: the letters A–Z and a–z, the digits 0–9, and four symbols: hyphen -, dot ., underscore _ and tilde ~. Encoding them is allowed but pointless: %41 and A mean the same thing, and the standard says they should be left as they are.
Reserved characters: they have a job
Reserved characters split an address into its parts. The main ones are : after the scheme, / between path segments, ? before the query, # before the fragment, @ in user information, & between parameters and = between a parameter name and its value. Others, such as + , ; ! * ' ( ) $ [ ], are reserved for special uses too. When one of these characters is part of your data rather than part of the structure, you must encode it. A search for "salt & pepper" has to be sent as q=salt%20%26%20pepper; written as q=salt & pepper, the server sees a parameter q with the value "salt " and a second, empty parameter called " pepper".
Other characters
Everything else must always be encoded: spaces, quotation marks, < and >, curly braces, the backslash, the percent sign itself (%25) and every character outside ASCII.
Why a space becomes %20 or +
Both are correct, in different places. In the URL standard a space is always %20. The plus sign comes from HTML forms: when a form is sent with the type application/x-www-form-urlencoded, the browser writes spaces as +. Because search boxes are forms, you often see ?q=green+tea in query strings, and servers decode + to a space there.
Outside the query string, the plus sign is just a plus sign. In the path /c++-guide it means two real plus characters, not spaces. That is why the safe rule is: use %20 in paths, and either %20 or + in query values. If your data contains a real plus, for example a phone number or "C++", it must be sent as %2B in a query, or the server reads it as a space.
This tool lets you choose. In Form data mode the encoder writes spaces as + and a real plus as %2B, and the decoder turns every + into a space, the same as URLSearchParams in JavaScript. In Component and Full URL mode a space becomes %20, and a + stays a plus when you decode, which is the safe choice for paths. So use Component for a path segment or a single value, and Form data when you build or read a query string that a form sends.
Non-ASCII text in URLs: Arabic, Hindi, Russian and accented letters
A URL can carry text in any language, but only after it has been turned into bytes. The rule (RFC 3986 and the WHATWG URL Standard that browsers follow) is to convert the text to UTF-8 first and then percent-encode every byte. A letter from outside ASCII takes two to four bytes in UTF-8, so it becomes two to four % codes:
cafébecomescaf%C3%A9(é is two bytes).- Russian
чай("tea") becomes%D1%87%D0%B0%D0%B9(two bytes per Cyrillic letter). - Arabic
شاي("tea") becomes%D8%B4%D8%A7%D9%8A(two bytes per letter). - Hindi
चाय("tea") becomes%E0%A4%9A%E0%A4%BE%E0%A4%AF(three bytes per Devanagari character).
That is why non-English addresses look so long when you paste them into an email or a document. Browsers usually show the readable form in the address bar, example.com/menu/café, but send the encoded bytes to the server, and they often copy the encoded form when you copy the link. Both forms point to the same page. To read such a link, paste it here and click Decode.
Domain names are different. Non-ASCII domains such as bücher.example are not percent-encoded; they are converted to Punycode, which starts with xn--. This tool does not convert domain names to Punycode, so use it for the path, the query and the fragment.
If decoded text shows strange characters such as é instead of é, the bytes were encoded with one character set and decoded with another. Modern sites should always use UTF-8. Old addresses encoded in Windows-1251 or ISO-8859-1 can still turn up in logs, and they decode correctly only with the original character set.
encodeURIComponent vs encodeURI
If you write JavaScript, you have two built-in functions, and choosing the wrong one is a classic bug:
encodeURIComponent()is for one piece of a URL, such as a single parameter value or one path segment. It encodes everything except letters, digits and- _ . ! ~ * ' ( ). So it encodes& = ? / # : +and spaces become%20.encodeURIComponent("green tea & honey")returnsgreen%20tea%20%26%20honey.encodeURI()is for a whole address that is already put together. It leaves the characters with a structural job alone (: / ? # & = + @ ; , $) and encodes only spaces, non-ASCII text and a few other characters.encodeURI("https://example.com/menu/café?q=green tea")returnshttps://example.com/menu/caf%C3%A9?q=green%20tea.
The rule of thumb: build URLs from encoded parts with encodeURIComponent, and use encodeURI only to clean up a complete address you trust. encodeURI will not protect a value that contains & or #. In modern code, URLSearchParams and the URL object do this for you (they write spaces in query values as +, like a form). The decoding functions are decodeURIComponent() and decodeURI(); note that neither of them turns + into a space.
In PHP the matching pair is rawurlencode() (RFC 3986 style, space as %20, tilde left alone) and urlencode() (form style, space as +, tilde encoded as %7E). In our tool, Component mode is close to rawurlencode() (it leaves ! * ' ( ) unencoded), and Form data mode treats spaces and plus signs the same way as urlencode() and urldecode().
Query strings and UTM parameters
A query string starts after ? and contains name=value pairs joined by &. Google's own URL guidance recommends exactly this format. Only the names and values are encoded, never the ?, = and & that hold them together.
UTM parameters for campaign tracking in Google Analytics follow the same rules. A link like this one is correct:
https://example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring%20sale
The campaign name "spring sale" contains a space, so it is written as spring%20sale (or spring+sale). Analytics decodes the value and reports "spring sale". Practical tips:
- Use lowercase names with hyphens or underscores, such as
spring-sale, so you never need to encode them and so "Spring Sale" and "spring sale" do not end up as two campaigns. - Encode any
&,#,=or?in a value. A campaign called "Tea & Coffee" must beTea%20%26%20Coffee, or everything after the&is lost. - When a link goes through a redirect or a link shortener, check the final address with our Redirect Checker to see whether the parameters arrive intact.
- Put the fragment (
#section) after the query, never before it. Everything after#stays in the browser and never reaches the server or analytics as part of the query.
Encode the parts, not the whole URL
The most common use of an encoder is to place one value safely inside a link. Paste only that value into the tool, not the whole address. For example, to send the address of one page as a parameter to another, paste https://example.com/a?b=1, copy the encoded result https%3A%2F%2Fexample.com%2Fa%3Fb%3D1 and append it: https://example.com/share?url=https%3A%2F%2Fexample.com%2Fa%3Fb%3D1. If you did not encode it, the ?b=1 would be read as a parameter of the share link. Use Component mode for this: Full URL mode would leave the ? and = unencoded.
Common URL encoding mistakes
Double encoding
Text that is encoded twice gets %25 in front of every code: %20 becomes %2520, and the visitor sees "green%20tea" in a search box instead of "green tea". It happens when a CMS, a plugin and your own code all encode the same value. If you see %25 followed by two hex digits in a link, it has almost certainly been encoded twice. Decode it once with this tool; if the result still contains % codes that should be readable, decode that result again. Then make sure only one step in your system does the encoding.
Encoding the whole address
Running a complete link through a component encoder turns https:// into https%3A%2F%2F, and the link stops working as a link. Encode the values, not the structure. If you only want to make a complete address safe, choose Full URL mode, which keeps https:// and the separators. The tool warns you when you encode a whole address in Component mode.
A raw % or + in data
A discount code "50%OFF" must be sent as 50%25OFF, otherwise the server tries to read %OF as a code. A real plus must be %2B in a query, or it turns into a space.
Different encodings of the same page
For a server, /caf%C3%A9, /caf%c3%a9 and /café can arrive in different forms, and links that mix them can make one page look like several URLs to crawlers. Link to each page in one consistent form, set a canonical URL, and check it with our Canonical and Hreflang Checker. Remember that the path is case sensitive: /Tea and /tea are different URLs.
Decoded text pasted back into a link
As the screenshot above shows, decoding can turn an encoded & into a real one and change the meaning of a link. Use the decoded text for reading and checking only.
URL encoding and SEO
Google's documentation on URL structure gives clear advice that is closely connected to encoding:
- Readable URLs are better. Use words that describe the content, such as
/wiki/aviation, rather than long strings of IDs and parameters. - Use the language of your audience. Google's own examples include German and Japanese words in URLs. Non-ASCII words are fine as long as they are encoded as UTF-8. In links in your HTML, Google recommends writing them percent-encoded, for example an Arabic path as
%D9%86%D8%B9%D9%86%D8%A7%D8%B9, and visitors still see the readable words in their browser. - Separate words with hyphens, not underscores, and do not run words together.
- Use
=and&for parameters, keep the number of parameters small, and remove ones that do not change the content, such as session IDs. - Do not use fragments (
#) to load different content, because Google generally ignores them.
Encoding itself does not help or hurt rankings. Broken encoding does: links that return 404 because of a double-encoded character, duplicate URLs, and sitemaps with invalid characters. URLs in an XML sitemap must be properly encoded, and the & in them must also be escaped as & for XML. Our XML Sitemap Generator handles that. When you change old addresses with spaces or special characters into clean ones, set up 301 redirects with the .htaccess Redirect Generator.
Practical uses
- Reading a link from a log or an email. Decode a long address from server logs or analytics to see which page or search term it really was.
- Building tracking links. Encode campaign names and values with spaces or symbols before you add them to UTM parameters.
- Passing a URL as a parameter. Share buttons, login redirects and "return to" links need the target address fully encoded.
- Testing APIs. Encode query values for an API call, or decode a request you copied from the browser's developer tools.
- Checking redirect and rewrite rules. Redirect rules often compare against the encoded path. Encode a non-ASCII path to see exactly what the server receives.
FAQ
What does %20 mean in a URL?
It is an encoded space. 20 is the hexadecimal value of the space character, so %20 stands for one space. In a query string a space is often written as + instead, which means the same thing there.
Should I use %20 or + for spaces?
Use %20 in the path of a URL. In query values both work, because servers decode + as a space in form-encoded data. In this tool, Component and Full URL mode write %20, and Form data mode writes +.
Which mode should I choose?
Choose Component to encode one value that goes into a link, such as a search term or a redirect address. Choose Full URL to make a complete address with spaces or non-English letters safe without breaking it. Choose Form data to read or build a query string the way an HTML form sends it, with + for spaces.
How do I decode a URL with Arabic, Hindi or Cyrillic text?
Paste the encoded link and click Decode. The result shows the original words, because the tool reads the percent codes as UTF-8 text. If you get a message about invalid UTF-8, the link was probably cut off or encoded with an older character set.
What is %2520 in a link?
It is a double-encoded space: %25 is the encoded percent sign, followed by 20. Decode it once to get %20, and fix the place in your system that encodes the value twice.
Are non-English URLs bad for SEO?
No. Google recommends words in your audience's language and supports non-ASCII characters in URLs when they are encoded as UTF-8. Keep them short, descriptive and consistent.
Is the URL encoder free?
Yes. It is free to use without registration, and there is no limit on how often you use it.