Back to blog

URL encodingURL decodingPercent encodingDeveloper tools

URL Encode and Decode: %20, + and %2520 Guide

Learn to URL-encode full links or single parameters, decode percent-encoded text, and fix %20, plus-sign, and double-encoding problems locally in your browser.

URL encoding and decoding turn Chinese text, spaces, and special characters into percent-encoded text, or restore that text to something readable. When you see a value such as %E4%B8%AD…, %20, or %2520, paste it into Yaya Tools’ URL Encode / Decode tool to inspect the conversion. Input and output stay in the current browser.

The common mistake is not knowing how to encode. It is not knowing whether you are encoding a full link, one parameter value, or text that has already been encoded once. Separate those jobs first and API debugging gets much easier.

URL encoding is not garbled text

RFC 3986 defines the generic URI syntax and percent-encoding. Browsers and servers use this representation to express characters that are not suitable in certain URI positions as transport text.

For example, a space is commonly percent-encoded as %20. Chinese characters become a sequence of percent-prefixed byte values, which is why the result looks long. Decoding restores the visible characters. This is not encryption and it does not hide the content.

Encoding a full URL versus one parameter value

This tool uses the browser’s encodeURIComponent for encoding. It treats your input as one string to convert; it does not parse a URL and selectively transform just one component.

Suppose a query-parameter value is:

text
Shanghai weather&tomorrow

Encoding it as one parameter value converts both the space and &. That keeps the ampersand from being read as the separator for another parameter.

If you instead enter a complete https://example.com/search?q=Shanghai URL and encode it directly, the :, /, ?, and = characters are encoded too. That is correct when the complete URL itself becomes the value of another parameter. When an API expects an ordinary navigable URL, encode only the relevant parameter values and preserve the URL’s structural separators.

Encode or decode a URL in three steps

1. Decide whether your input is plain text or percent-encoded text

Plain text often contains Chinese characters, spaces, or ordinary symbols. Encoded text contains % followed by two hexadecimal characters, such as %20. Open the URL Encode / Decode tool and paste the value into the input field.

2. Choose Encode or Decode for the job

Choose “Encode” when you need to place plain text into a URL parameter, redirect value, or API request. Choose “Decode” when you need to read percent-encoded text from a log, callback URL, or API response. The result appears on the right and can be copied.

3. Check the surrounding format before using the result

Do not stop at whether a conversion succeeds. Confirm whether the value sits in a parameter, a full URL, a JSON string, or form data. For JSON request bodies, use the JSON Formatter first to inspect the fields and escaping layers before changing a URL value.

What %20, +, and %2520 mean

Form Common meaning What this tool does
%20 Percent-encoded space Decodes it to a space
+ Often represents a space in application/x-www-form-urlencoded form data The tool uses decodeURIComponent, so it does not automatically turn + into a space
%2520 The percent sign in %20 was encoded again One decode gives %20; a second decode gives a space

The relationship between + and a space belongs to form-encoding rules; not every URL decoder should replace it. This tool follows the browser’s decodeURIComponent: input a+b remains a+b. Confirm the encoding rule used by the API before applying a form-data transformation.

How to troubleshoot double URL encoding

During a second encoding pass, the original percent sign % becomes %25. So:

text
space → %20 → %2520

When you see %2520, do not manually replace every %25 at once. Decode once and check whether the result is %20; if it is, decode once more. Review the output after each pass so you do not alter a percent sign that should remain literal.

Double encoding often comes from a front end that already encoded a parameter, a router that encoded it again, or server-side URL assembly that adds another pass. Record the plain and encoded value at each step instead of guessing which layer failed.

URL encoding, Base64, and JSON escaping do different jobs

Situation Use first Goal
Special characters in a URL path or query value URL Encode / Decode Create or restore percent encoding
A general Base64 text string Base64 Encode / Decode Convert using Base64 rules
Backslashes, quotes, or nested data in a JSON string JSON Formatter Inspect JSON syntax and field structure

All three can make text look unfamiliar, but they are not interchangeable. For common Base64 use cases, Chinese-text issues, and failed decoding, see the Base64 encoding and decoding guide.

Frequently asked questions

What does URL encoding do to Chinese text?

It converts the text into percent-encoded byte values, where each component begins with % followed by two hexadecimal characters. Use Decode to restore readable Chinese text.

Why do I still see a + after decoding?

The tool uses decodeURIComponent, which restores percent encoding but does not change a plus sign into a space. A plus sign representing a space is a convention of form encoding, so handle it according to the API’s actual rule.

Is URL encoding encryption?

No. Percent encoding is a text representation for URI transport and parsing. Anyone can decode and read it, so do not use it to hide sensitive information.

What should I do when decoding fails?

Check that every % is followed by two valid hexadecimal characters and that the value was not truncated. For double-encoded text such as %2520, decode one layer at a time instead of skipping directly to a guessed result.

Choose the encoding from the value’s location

Open the online URL Encode / Decode tool, convert the plain or percent-encoded value once, then decide whether it is a full link or a parameter value. Getting that layer right matters more than repeatedly encoding the same text.

On this page