Encoders / DecodersLesson 14Free preview
URL Encode/Decode
This lesson is part of Web Developer Tools · All levels
Summary
URL Encoder converts an unsafe or special meaning character in a URL into a percentage form, e.g. spaces to %20. Encoding is required because the URL can only contain certain characters, and characters like & or = have a function as a parameter separator. The decoder returns the percent text to the original characters. When sending data via a query string, encode each value separately so that the URL structure is not corrupted.
Key points
- Change the special character to a percentage followed by the hexadecimal code
- Space can be represented as %20 or + on the form
- The characters &, =,?, and # have specific meanings in the URL
- Encode the parameter values separately, not the entire raw URL
- Decode restores the original text and should not be repeated
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.