URL Encode / Decode
Encode and decode URLs and URI components for safe transmission and proper formatting.
What is URL Encoding?
URL encoding is a method used to safely transmit special characters, spaces, and Unicode characters in URLs. It converts special characters to '%' symbol followed by hexadecimal codes.
Processing Mode Descriptions
- • Standard URL Encoding: Uses encodeURIComponent() or encodeURI()
- • Query String (qs): Convert objects to query strings or parse them
- • Form Data: Handle form data in key=value format
When to Use?
- • When including special characters or non-ASCII characters in URL query parameters
- • When transmitting form data
- • When sending data with special characters in API requests
- • When ensuring URL safety in web development
Common Encoding Characters
qs Library Example
import qs from 'qs'; const encoded = qs.stringify({ a: '1 2', b: ['x', 'y'] }, { encode: true }); // → a=1%202&b[0]=x&b[1]=y const decoded = qs.parse(encoded); // → { a: '1 2', b: ['x', 'y'] }
Character Encoding
Character encoding refers to converting strings to specific encoding formats. In URL encoding, character encoding can convert strings to various encoding formats like UTF-8, EUC-KR, ISO-8859-1, etc.