T

URL Encoder/Decoder

Online URL Encoder and Decoder

Input
Output
Charset:

URL Encoder/Decoder Description

Encode or decode URLs to ensure they are safe for the web. URL encoding (Percent-encoding) is a mechanism for encoding information in a Uniform Resource Identifier (URI). Now supports multiple character set encodings like GBK, Big5, and more.

How to use

  1. Enter the URL or string you want to process.
  2. Select the character set (default is UTF-8).
  3. Choose between 'Encode' to make it URL-safe or 'Decode' to make it human-readable.
  4. The result will appear instantly.

Common Scenarios

  • Encoding query parameters to prevent broken links.
  • Decoding complex URLs to understand the passed data.
  • Handling special characters like spaces, symbols, or non-ASCII characters in web addresses in different encodings.

Data Structure & Rules

URLs use a limited set of ASCII characters. Reserved characters like ?, &, =, and / have special meanings. Unsafe characters are replaced with % followed by their two-digit hexadecimal representation.

Principles

The tool uses encodeURIComponent and decodeURIComponent for component-level processing, or encodeURI/decodeURI for full URLs, ensuring compliance with RFC 3986. For non-UTF-8 charsets, it uses TextDecoder and custom percent-encoding logic.