Online URL codec tool| Encode/decode special characters- GoTool Online Toolkit

开发工具指南

This tool provides URL encoding and decoding tools that support encoding special characters in URLs to ensure the security and consistency of data during transmission. The tool can also decode the encoded URL into the original format for easy processing and parsing. It is suitable for various scenarios that require URL processing, simplifying data transmission and exchange processes.

使用说明

Function introduction

  1. Use JavaScript's encodeURI and encodeURIComponent for encoding.
  2. Use JavaScript's decodeURIComponent to decode.

Method Introduction

encodeURI

  • Purpose: Used to encode the entire URI. For example: "http://example.com/This is a test? name= Zhang San ".
  • Encoding rules: Only characters with special meaning in the URI will be encoded, such as spaces (encoded as %20),#(encoded as %23), etc. The following characters will not be encoded: A-Z,a-z,0-9,-,_,.!,~,*, '、(、)、;、/、?、:、@、&、=、+、$、,`,Because these characters have a specific meaning in the URI.

encodeURIComponent

  • Purpose: Used to encode part of the URI (such as the values of query parameters), rather than the entire URI. For example: "name= Zhang San &age=25".
  • Encoding rules: encodeURIComponent encodes all non-alphanumeric characters, including ;,/,?:,@,&,=,+,$,,, etc., because these characters have no special meaning in the URI component, they are all encoded.

decodeURIComponent

  • Purpose: Used to decode individual URI components (such as the values of query parameters) and restore the characters encoded by encodeURIComponent to the original characters.
  • Decoding rules: decodeURIComponent will decode all characters encoded by encodeURIComponent and convert the encoding starting with % back to the corresponding character. For example,%20 will be decoded as spaces, and %3D will be decoded as =.