URL Encoding/Decoding

Online URL encoding and decoding tool, supports RFC standards and custom conversion methods to achieve bidirectional conversion of URL parameters, Chinese and other content.

Green Tool

Related Tools

Tool Introduction

The URL encoding/decoding tool is a powerful online utility designed to help users encode and decode special or non-ASCII characters in URLs (Uniform Resource Locators). In web development, data transmission, or API interaction, URLs containing non-standard characters (such as Chinese, spaces, question marks, & symbols, etc.) may cause parsing errors or data loss. This tool strictly follows international standards such as RFC 3986 and RFC 1738, and provides a variety of flexible conversion methods to ensure that your URL data can be transmitted and processed safely and accurately.

As a bidirectional conversion tool, it can not only encode the original string into a URL-compliant format, but also restore the encoded URL to the original readable string, greatly improving the work efficiency of developers and ordinary users.

How to Use

  1. Enter the content to be processed:
    • To encode, paste the original text or URL into the "Before Encoding" text box. For example: https://www.toolkk.com/search?keyword=计算器.
    • To decode, paste the encoded URL or text into the "After Encoding" text box. For example: https://www.toolkk.com/search?keyword=%E8%AE%A1%E7%AE%97%E5%99%A8.
  2. Select the encoding standard:
    • RFC 3986 (Recommended): This is the current universal URL encoding standard on the Internet, which specifies that spaces are encoded as %20.
    • RFC 1738 (Traditional): An earlier standard that encodes spaces as + in some traditional systems (such as application/x-www-form-urlencoded submitted by HTML forms).
  3. Select the conversion method (optional only when encoding):
    • Space to Plus: Convert all spaces to + signs instead of %20. This is very useful when processing certain form submission data.
    • Keep Unencoded Characters: According to the RFC standard, some non-reserved characters (such as letters, numbers, -._~) are not encoded to improve readability.
    • Force Full Encoding: Encode all characters (except ASCII alphanumeric characters), even those that are allowed to be reserved in the RFC standard.
  4. Perform the conversion: According to your needs, click the corresponding "Encode" or "Decode" button, and the result will be displayed immediately in another text box.

Usage Examples

  • Example 1: Encoding a URL containing Chinese (RFC 3986, default settings)
    • Operation Demonstration: Enter https://www.toolkk.com/search?keyword=计算器 in the "Before Encoding" text box, select "RFC 3986" for "Encoding Standard", keep the "Conversion Method" default (or do not select), and then click the "Encode" button.
    • Input Data: https://www.toolkk.com/search?keyword=计算器
    • Expected Output: https://www.toolkk.com/search?keyword=%E8%AE%A1%E7%AE%97%E5%99%A8
  • Example 2: Encoding a string containing spaces (Space to Plus mode)
    • Operation Demonstration: Enter hello world ! in the "Before Encoding" text box, select "Space to Plus" for "Conversion Method", and click the "Encode" button.
    • Input Data: hello world !
    • Expected Output: hello+world+!
  • Example 3: Decoding an encoded URL
    • Operation Demonstration: Enter https://www.toolkk.com/search?keyword=%E8%AE%A1%E7%AE%97%E5%99%A8 in the "After Encoding" text box, and then click the "Decode" button.
    • Input Data: https://www.toolkk.com/search?keyword=%E8%AE%A1%E7%AE%97%E5%99%A8
    • Expected Output: https://www.toolkk.com/search?keyword=计算器

Introduction to URL Encoding Standards

URL encoding (or percent encoding) is a mechanism used to convert special or non-ASCII characters contained in a URL into a network-safe format. The main standards are:

  • RFC 3986: This is the latest and recommended general syntax standard for URIs (including URLs). It specifies which characters are "reserved characters" (requiring encoding) and which are "non-reserved characters" (which can be left unencoded). According to RFC 3986, the space character should be encoded as %20. Most modern web systems and APIs follow this standard.
  • RFC 1738: This is an earlier URL specification that mentions in its appendix that when HTML form data (application/x-www-form-urlencoded) is submitted, the space character can be encoded as +. Although this is not a universal rule for URL encoding, it is still widely used in web form submissions and some older systems due to historical reasons. Therefore, when you see a space in a URL encoded as +, it is likely that you are processing this type of data.

This tool supports both encoding conventions and allows users to flexibly choose according to specific scenarios.

Common Questions

  • Q: What is the purpose of URL encoding? Why do I need it?
    A: The main purpose of URL encoding is to ensure the validity and security of URLs in network transmission. It converts special characters (such as spaces, Chinese, & symbols, question marks, etc.) that may cause ambiguity, conflicts, or cannot be directly transmitted in the URL into a unified percent-encoded format (for example, spaces become %20 or +, and Chinese characters are encoded as multiple %xx sequences). This avoids browsers or servers from incorrectly parsing the URL and ensures that data is transmitted completely and accurately, especially when passing Chinese parameters in GET requests.
  • Q: What are the differences between RFC 3986 and RFC 1738? Which one should I choose?
    A: They have a major difference in how they handle space characters. RFC 3986 specifies that spaces should be encoded as %20, which is now the more recommended and common practice. RFC 1738 (and the application/x-www-form-urlencoded standard) allows spaces to be encoded as +. If you are unsure, it is generally recommended to choose RFC 3986. If your data comes from HTML form submissions or needs to interact with systems that treat + as a space, you may need to choose RFC 1738 or use the "Space to Plus" conversion method.
  • Q: Why does my URL encode spaces as plus signs? How do I make it become %20?
    A: This is usually because you selected the "Space to Plus" conversion method, or you selected a mode similar to RFC 1738 when encoding. If you want spaces to be encoded as %20, make sure to select "RFC 3986 (Recommended)" as the encoding standard when encoding, and do not select the "Space to Plus" conversion method.

Precautions

  • Select the correct standard: When encoding or decoding URLs, be sure to select the RFC 3986 or RFC 1738 encoding standard and the appropriate conversion method according to the requirements of your application scenario or target system. Incorrect encoding/decoding standards may cause data to be parsed incorrectly.
  • Avoid double encoding: If part of the URL has already been encoded, avoid encoding it again, otherwise it may cause a "double encoding" problem, making decoding fail or produce incorrect results. Usually, you only need to encode the unencoded original string.
  • Input data format: Make sure that the input to the tool is a plain text string or a valid URL fragment. Although the tool can handle most characters, non-text or binary data is not suitable for direct input.
  • Character set: URL encoding is usually processed based on the UTF-8 character set, especially when it comes to multi-byte characters such as Chinese. Make sure that your original data source also uses UTF-8 encoding to avoid garbled characters.

Rating

0 / 5

0 ratings

Statistics

Views: 5013

Uses: 5712